Skip to main content

Treeview

info

For more details about Vuetify’s usage of Treeview component, click Treeview page.
For more prop explanations, click Vuetify Treeview API page.

Props

AttributeDescriptionTypeDefault
valueAllows one to control which nodes are selected. The array consists of the item-key of each selected item.array[]
itemsAn array of items used to build the treeviewarray[]
activatableAllows user to mark a node as active by clicking on itbooleanfalse
classProp that determines the class to add to the Treeviewstringundefined
colorApplies specified colorstringundefined
denseHide opposite slot content, and position all items to one side of timeline.booleanfalse
hovertableApplies a hover class when mousing over nodesbooleanfalse
itemDisabledSet property of items’s disabled valuestring - array - functiondisabled
loadingIconIcon used when node is in a loading statestring'$loading'
onIconIcon used when leaf node is selected or when a branch node is fully selected. Only visible when selectable is true.string'$checkboxOn'
openAllWhen true will cause all branch nodes to be opened when component is mountedbooleanfalse
openOnClickWhen true will cause nodes to be opened by clicking anywhere on it, instead of only opening by clicking on expand icon. When using this prop with activatable you will be unable to mark nodes with children as active.booleanfalse
selectableWill render a checkbox next to each node allowing them to be selectedbooleanfalse
selectedColorThe color of the selection checkboxstring'accent'
selectionTypeControls how the treeview selects nodes. There are two modes available: ‘leaf’ and ‘independent’string'leaf'
activeSyncable prop that allows one to control which nodes are active. The array consists of the item-key of each active itemarray[]
denseDecreases the height of the itemsbooleanfalse
expandIconIcon used to indicate that a node can be expandedstring'$subgroup'
itemChildrenProperty on supplied items that contains its childrenstring'children'
itemKeyProperty on supplied items used to keep track of node state. The value of this property has to be unique among all itemsstring'id'
itemTextProperty on supplied items that contains its label textstring'name'
multipleActiveWhen true, allows user to have multiple active nodes at the same timebooleanfalse
offIconIcon used when node is not selected. Only visible when selectable is truestring'$checkboxOff'
openSyncable prop that allows one to control which nodes are open. The array consists of the item-key of each open itemarray[]
openOnClickWhen true will cause nodes to be opened by clicking anywhere on it, instead of only opening by clicking on expand iconbooleanfalse
searchThe search model for filtering resultsstringundefined
shapedProvides an alternative active style for Treeview node. Only visible when activatable is truebooleanfalse
tabindexAllows component to give and receive focus.numberundefined
transitionApplies a transition when nodes are opened and closedbooleanfalse
visibleVisibility of Treeview componentbooleantrue

Events

AttributeDescription
input(array)Emits the array of selected items when this value changes
update:active(array)Emits the array of active items when this value changes
update:open(array)Emits the array of open items when this value changes

Slots

AttributeDescription
appendAppends content after label.{ item: any, leaf: boolean, selected: boolean, indeterminate: boolean, active: boolean, open: boolean }
labelLabel content.{ item: any, leaf: boolean, selected: boolean, indeterminate: boolean, active: boolean, open: boolean }
prependPrepends content before label.{ item: any, leaf: boolean, selected: boolean, indeterminate: boolean, active: boolean, open: boolean }

image

image

image

image

Samples Qjson

treeview
treeview2
TreeViewExample