BlogPlaygroundOne

VTreeview API


Props
name
type
default
boolean
false

Allows user to mark a node as active by clicking on it.

unknown
undefined

Array of ids of activated nodes.

string
undefined

The class applied to the component when it is in an active state.

string
undefined

Deprecated, use color instead.

  | 'single-leaf'
  | 'leaf'
  | 'independent'
  | 'single-independent'
  | ActiveStrategy
  | ((mandatory: boolean) => ActiveStrategy)
undefined

Affects how items with children behave when activated. If not specified, the single-independent strategy will be used.

  • leaf: Only leaf nodes (items without children) can be activated.
  • single-leaf: Similar as leaf, but only a single item can be activated at a time.
  • independent: All nodes can be activated whether they have children or not.
  • single-independent: Similar as independent, but only a single item can be activated at a time.
string
undefined

Sets the color of component when not focused.

string
undefined

Applies specified color to the control’s background. Used on components that also support the color prop. - supports utility colors with or without bg- prefix (for example success, purple or bg-purple) or CSS color (#033 or rgba(255, 0, 0, 0.5)). Find a list of built-in classes on the colors page.

string | number | boolean
false

Applies utility border classes to the component. To use it, you need to omit the border- prefix, (for example use border-sm as border="sm"). Find a list of the built-in border classes on the borders page.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$treeviewCollapse'

Icon to display when the list item is expanded.

string
undefined

Applies specified color to the active node - supports utility colors (for example success or purple) or css color (#033 or rgba(255, 0, 0, 0.5)). Find a list of built-in classes on the colors page.

FilterFunction
undefined

Function used to filter items, called for each filterable key on each item in the list. The first argument is the filterable value from the item, the second is the search term, and the third is the internal item object. The function should return true if the item should be included in the filtered list, or the index of the match in the value if it should be included with the result highlighted.

unknown
undefined

Function used on specific keys within the item object. customFilter is skipped for columns with customKeyFilter specified.

'default' | 'comfortable' | 'compact'
'default'

Adjusts the vertical height used by the component.

boolean
false

Disables selection for all nodes.

string | number
undefined

Designates an elevation applied to the component between 0 and 5. You can find more information on the elevation page.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$treeviewExpand'

Icon used to indicate that a node can be expanded.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
undefined

The icon used when inactive.

boolean
false

FOR INTERNAL USE ONLY Prevents list item selection using [space] key and pass it back to the text input. Used internally for VAutocomplete and VCombobox.

string | string[]
['title']

Array of specific keys to filter on the item.

'every' | 'some' | 'union' | 'intersection'
'intersection'

Controls how the results of customFilter and customKeyFilter are combined. All modes only apply customFilter to columns not specified in customKeyFilter.

  • some: There is at least one match from either the custom filter or the custom key filter.
  • every: All columns match either the custom filter or the custom key filter.
  • union: There is at least one match from the custom filter, or all columns match the custom key filters.
  • intersection: There is at least one match from the custom filter, and all columns match the custom key filters.
boolean
false

Removes indentation from nested items.

string | number
undefined

Sets the height for the component.

boolean
false

Hide the expand icon and loading indicator next to each item title.

boolean
false

Hides the menu when there are no options to show. Useful for preventing the menu from opening before results are fetched asynchronously. Also has the effect of opening the menu when the items array changes if not already open.

string | number
undefined

Overrides the indent size for nested groups.

boolean | 'default' | 'simple'
false

Controls visibility and variant of the indent lines.

string
undefined

Sets color of indent lines

string | number
undefined

Sets opacity of indent lines

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
'$checkboxIndeterminate'

Icon used when node is in an indeterminate state. Only visible when selectable is true.

SelectItemKey
'children'

Property on supplied items that contains its children.

SelectItemKey
'props'

Props object that will be applied to each item component. true will treat the original object as raw props and pass it directly to the component.

unknown[]
[]

An array of items used to build the treeview.

'props' | 'render'
'render'

When set to ‘props’, skips rendering collapsed items/nodes (for significant performance gains).

SelectItemKey
'title'

Property on supplied items that contains its title.

SelectItemKey
'type'

Designates the key on the supplied items that is used for determining the nodes type.

SelectItemKey
'value'

Property on supplied items that contains its value.

false | 'one' | 'two' | 'three'
'one'

Designates a minimum-height for all children v-list-item components. This prop uses line-clamp and is not supported in all browsers.

(item: unknown) => Promise<void>
undefined

A function used when dynamically loading children. If this prop is set, then the supplied function will be run if expanding an item that has a item-children property that is an empty array. Supports returning a Promise.

string
'$loading'

Icon used when node is in a loading state.

boolean
false

Forces at least one item to always be selected (if available).

string | number
undefined

Sets the maximum height for the component.

string | number
undefined

Sets the maximum width for the component.

string | number
undefined

Sets the minimum height for the component.

string | number
undefined

Sets the minimum width for the component.

unknown
undefined

Allows one to control which nodes are selected. The array contains the values of currently selected items. It is equivalent to the v-model:selected

number
undefined

Specifies the currently selected navigation index when using navigationStrategy="track". Can be used with v-model:navigationIndex for two-way binding. Items at this index receive visual keyboard focus styling and automatic scrolling. Note: Only works with the items prop, not with slotted items.

'focus' | 'track'
'focus'

Determines keyboard navigation behavior. focus (default) moves DOM focus to items, suitable for traditional lists. track provides visual keyboard focus without moving DOM focus, ideal for command palettes and autocomplete where an external element retains focus. When track mode is active, items automatically receive tabindex="-1", proper aria-activedescendant is set on the list container, and keyboard-focused items display focus-visible styling with auto-scrolling.

string
'$vuetify.noDataText'

Text shown when no items are provided to the component.

boolean
false

Disables all item filtering.

boolean
false

When true will cause all branch nodes to be opened when component is mounted.

unknown
undefined

An array containing the values of currently opened groups. Can be two-way bound with v-model:opened.

boolean
undefined

When 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.

string | number
undefined

Sets the horizontal spacing between prepend slot and the main content within list item. Also affects indent to ensure expected alignment of group children.

boolean
false

When true will make v-model, v-model:selected, v-model:activatedandv-model:opened` return the complete object instead of just the key.

string | number | boolean
undefined

Provides an alternative active style for v-treeview node. Only visible when activatable is true and should not be used in conjunction with the shaped prop.

string
undefined

The search model for filtering results.

boolean
false

Will render a checkbox next to each node allowing them to be selected. Additionally, the openOnClick property will be applied internally.

unknown
undefined

An array containing the values of currently selected items. Can be two-way bound with v-model:selected.

string
undefined

The color of the selection checkbox.

  | 'single-leaf'
  | 'leaf'
  | 'independent'
  | 'single-independent'
  | 'classic'
  | 'trunk'
  | 'branch'
  | SelectStrategy
  | ((mandatory: boolean) => SelectStrategy)
'single-leaf'

Affects how items with children behave when selected.

  • leaf: Only leaf nodes (items without children) can be selected.
  • independent: All nodes can be selected whether they have children or not.
  • classic: Selecting a parent node will cause all children to be selected, parent nodes will be displayed as selected if all their descendants are selected. Only leaf nodes will be added to the model.
  • trunk: Same as classic but if all of a node’s children are selected then only that node will be added to the model.
  • branch: Same as classic but if any of a node’s children are selected then that node will also be added to the model.
boolean
false

Applies to default variant of indent-lines. Prevents showing lines between root-level nodes.

boolean
true

Reduces horizontal spacing for badges, icons, tooltips, and avatars within slim list items to create a more compact visual representation.

string | (new () => any) | FunctionalComponent
'div'

Specify a custom tag used on the root element.

string
undefined

Specify a theme for this component and all of its children.

boolean
false

Removes any applied border-radius from the component.

  | string
  | (string | [string, number])[]
  | (new () => any)
  | FunctionalComponent
undefined

The icon used when active.

(a: any, b: any) => boolean
undefined

Apply a custom comparison algorithm to compare model-value and values contains in the items prop.

'text' | 'flat' | 'elevated' | 'tonal' | 'outlined' | 'plain'
'text'

Applies a distinct style to the component.

string | number
undefined

Sets the width for the component.

Events
name
type
[{ id: unknown; value: boolean; path: unknown[] }]

Emits the item when it is clicked to open.

[{ id: unknown; value: boolean; path: unknown[] }]

Emits the item when it is clicked to select.

[unknown]

Emits the array of active items when this value changes.

[unknown]

Event that is emitted when the component’s model changes.

[unknown]

Emits the array of open items when this value changes.

[unknown]

Emits the array of selected items when this value changes.

Slots
{ index: number depth: number path: number[] isFirst: boolean isLast: boolean isActive: boolean isOpen: boolean isSelected: boolean isIndeterminate: boolean isDisabled: boolean select: (value: boolean) => void } & { item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }
never
{ props: { title: string; value: any; [string]: any } }
{ props: { indentLines: ('none' | 'leaf' | 'last-leaf' | 'line' | 'leaf-link')[] } item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } loading: boolean }
{ props: { title: string; value: any; [string]: any } item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } loading: boolean }
{ props: { title: string; value: any; [string]: any } item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }
never
{ index: number depth: number path: number[] isFirst: boolean isLast: boolean isActive: boolean isOpen: boolean isSelected: boolean isIndeterminate: boolean isDisabled: boolean select: (value: boolean) => void } & { item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }
{ props: { title: string; value: any; [string]: any } }
{ subtitle: string | number | boolean } & { item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }
{ title: string | number | boolean } & { item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }
{ index: number depth: number path: number[] isFirst: boolean isLast: boolean isActive: boolean isOpen: boolean isSelected: boolean isIndeterminate: boolean isDisabled: boolean select: (value: boolean) => void } & { props: { onClick: (e: PointerEvent) => void } } & { loading: boolean } & { item: unknown internalItem: { title: string props: { title: string; value: any; [string]: any } children: ListItem[] type: string value: any raw: unknown } }

Appends content after label.

The default Vue slot.

Slot for custom divider.

Slot for footer below expanded children.

Slot for expandable nodes (all items that are not leafs).

Slot for rendering custom list items. Receives { props } where props contains item data (title, subtitle, value, etc.) plus index (the item’s position in the list). Use this to completely customize item rendering while still using VList’s navigation and selection features.

Defines content for when no items are provided.

Prepends content before label.

Slot for custom subheader.

Slot for the component’s subtitle content.

Slot for the component’s title content.

Slot for custom expand icon and loading indicator.

SASS Variables