VTreeview API
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 | ||
| '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.
| ||
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 | ||
string | number | boolean | false | |
Applies utility border classes to the component. To use it, you need to omit the | ||
| 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 | ||
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. | ||
'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
| ||
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 | ||
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 | ||
SelectItemKey | 'children' | |
Property on supplied | ||
SelectItemKey | 'props' | |
Props object that will be applied to each item 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 | ||
SelectItemKey | 'type' | |
Designates the key on the supplied items that is used for determining the nodes type. | ||
SelectItemKey | 'value' | |
Property on supplied | ||
false | 'one' | 'two' | 'three' | 'one' | |
Designates a minimum-height for all children | ||
(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 | ||
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 | ||
number
| undefined | |
Specifies the currently selected navigation index when using | ||
'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 | ||
string
| '$vuetify.noDataText' | |
Text shown when no items are provided to the component. | ||
boolean
| false | |
Disables all item filtering. | ||
boolean
| false | |
When | ||
unknown
| undefined | |
An array containing the values of currently opened groups. Can be two-way bound with | ||
boolean
| undefined | |
When | ||
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 | ||
string | number | boolean | undefined | |
Provides an alternative active style for | ||
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 | ||
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.
| ||
boolean
| false | |
Applies to | ||
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. | ||
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. | ||
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 | ||
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. | ||
name | default |
|---|---|
4px | |
rgb(var(--v-theme-on-surface)) | |
6px | |
4px | |
solid | |
1px | |
math.round(math.div($treeview-indent-line-width, 2)) | |
0 | |
.4 | |
8px | |
28px | |
-6px | |
10px |