GhostTreeItem reference
Package: @ghostvue/vue. Status: experimental (stability policy).
Keyed role="treeitem" node (default <li>) and roving focus target. Sets aria-selected, aria-disabled, and for branches (a GhostTreeGroup inside) aria-expanded and aria-controls; links aria-labelledby to its first labelling GhostTreeTrigger so the name excludes child items. Row clicks select and, with expandOnClick, toggle; clicks bubbling from nested items are ignored.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
as | GhostTreeItemElement | "li" | No | Tag name or component rendered for the `role="treeitem"` node. |
disabled | boolean | false | No | Disables selection, expansion, and roving focus for this node only. |
textValue | string | — | No | Explicit typeahead label; defaults to the trigger or own text. |
value | string | — | Yes | Unique, stable key used in `modelValue`, `expanded`, and focus tracking. |
Emits
None declared.
Models
None declared.
Slots
| Name | Description |
|---|---|
default | Item content: usually one GhostTreeTrigger and, for branches, one GhostTreeGroup. |
Slot props: default
| Name | Type | Description |
|---|---|---|
disabled | boolean | Slot prop `disabled`. |
expandable | boolean | Slot prop `expandable`. |
expanded | boolean | Slot prop `expanded`. |
focused | boolean | Slot prop `focused`. |
level | number | Slot prop `level`. |
select | () => void | Slot prop `select`. |
selected | boolean | Slot prop `selected`. |
toggle | () => void | Slot prop `toggle`. |
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Exposed method `blur`. |
element | HTMLElement | null | Exposed property `element`. |
focus | (options?: FocusOptions) => void | Exposed method `focus`. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | item | role="treeitem" node rendered by GhostTreeItem. |
data-state | checked | data-state on a selected item. |
data-state | disabled | data-state on a disabled, unselected item. |
data-ghost-tree-value | present | GhostTreeItem element; carries the item value string (free-form, so no fixed values are listed). |
data-selected | present | Present on GhostTreeItem and its GhostTreeTrigger while the item is selected. |
data-expanded | true, false | On branch GhostTreeItem elements only; mirrors aria-expanded. |
data-disabled | present | Present on the root, items, and triggers that are disabled (root or own flag). |
data-level | 1, 2, 3 | 1-based depth on each GhostTreeItem (any positive integer; first levels listed). |
CSS variables
| Name | Description |
|---|---|
--ghost-tree-level | 1-based depth set inline on each GhostTreeItem; themes use it for logical indentation. Consumers may override it. |
Accessibility
Role: treeitem. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/.
Required ARIA attributes: aria-selected.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Tab | Moves focus into and out of the tree through its single roving tab stop. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
ArrowDown | Moves focus to the next visible enabled item without changing selection; wraps only when loop is true. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
ArrowUp | Moves focus to the previous visible enabled item without changing selection; wraps only when loop is true. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
ArrowRight | LTR: expands a closed branch, or moves to the first visible enabled child of an open branch. RTL: collapses an open branch, or moves to the closest visible enabled ancestor. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
ArrowLeft | LTR: collapses an open branch, or moves to the closest visible enabled ancestor. RTL: expands a closed branch, or moves to the first visible enabled child of an open branch. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
Home | Moves focus to the first visible enabled item. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
End | Moves focus to the last visible enabled item. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
Enter | Selects the focused item (single), deselects it when allowDeselect is true, or toggles it (multiple). Never toggles expansion. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
| Same as Enter when no typeahead query is active; otherwise appends a space to the query. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
* | Expands every closed enabled sibling branch of the focused item in one update. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
a-z | Printable characters run a 500ms typeahead over visible enabled items, moving focus without selecting. | GhostTree @component:GhostTree › tree/basic: one Tab stop, every documented key, and Axe in both states (@ghostvue/vue) |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Passed | Every declared key maps to a Chromium browser test that CI runs and requires to pass on every commit. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
None declared.