- Components
- Button
- Tree
- Forms
- Input
- Select (beta)
- Design system accessibility review checklist.md
- Tokens
GhostTree reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrappers around headless GhostTree, GhostTreeItem, GhostTreeTrigger, and GhostTreeGroup. Importing from @ghostvue/themes loads ghost-tree.css: token-based rows indented from --ghost-tree-level with logical padding, selected and hover row states, a focus ring on the focused item row only, reduced-motion-aware group height transitions, and forced-colors support.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
allowDeselect | boolean | false | No | In single mode, re-activating the selected node clears the selection. Forwarded to headless GhostTree. |
as | GhostTreeElement | "ul" | No | Tag name or component rendered for the `role="tree"` container. Forwarded to headless GhostTree. |
defaultExpanded | string[] | "[]" | No | Initial expanded branch values when `expanded` is omitted. Forwarded to headless GhostTree. |
defaultValue | GhostTreeValue | — | No | Initial uncontrolled selection. Forwarded to headless GhostTree. |
dir | GhostTreeDirection | — | No | Explicit writing direction; otherwise inherited from `[dir]`. Forwarded to headless GhostTree. |
disabled | boolean | false | No | Disables every interaction in the tree. Forwarded to headless GhostTree. |
expanded | string[] | — | No | Controlled expanded branch values (`v-model:expanded`). Forwarded to headless GhostTree. |
expandOnClick | boolean | true | No | Pointer clicks on a branch row also toggle expansion. Forwarded to headless GhostTree. |
loop | boolean | false | No | `ArrowDown` / `ArrowUp` wrap at the ends of the visible node list. Forwarded to headless GhostTree. |
modelValue | GhostTreeValue | — | No | Controlled selection (`v-model`). Omit for uncontrolled mode. Forwarded to headless GhostTree. |
selectionMode | GhostTreeSelectionMode | "single" | No | Single (`string | undefined`) or multiple (`string[]`) selection. Forwarded to headless GhostTree. |
Emits
| Name | Payload | Description |
|---|---|---|
select | GhostTreeSelectPayload | Emitted as `select`. |
toggle | GhostTreeTogglePayload | Emitted as `toggle`. |
Models
| Prop | Event | Type | Description |
|---|---|---|---|
expanded | update:expanded | string[] | v-model binding for `expanded`. |
modelValue | update:modelValue | GhostTreeValue | v-model binding for `modelValue`. |
Slots
| Name | Description |
|---|---|
default | GhostTreeItem nodes; receives selection, expansion, and focus state plus select/toggle helpers. |
Slot props: default
| Name | Type | Description |
|---|---|---|
expandAllSiblings | (value: string) => void | Slot prop `expandAllSiblings`. |
expanded | string[] | Slot prop `expanded`. |
focusedValue | string | undefined | Slot prop `focusedValue`. |
isExpanded | (value: string) => boolean | Slot prop `isExpanded`. |
isSelected | (value: string) => boolean | Slot prop `isSelected`. |
modelValue | GhostTreeValue | Slot prop `modelValue`. |
select | (value: string) => void | Slot prop `select`. |
toggleExpanded | (value: string) => void | Slot prop `toggleExpanded`. |
Exposed members
| Name | Type | Description |
|---|---|---|
blur | () => void | Exposed method `blur`. |
element | HTMLElement | null | Exposed property `element`. |
focus | (options?: FocusOptions) => void | Focuses the current roving tab stop item, if any. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | Tree container with data-themed. |
data-part | item | Tree item; indents from --ghost-tree-level. |
data-part | trigger | Item row: hover, selected, disabled, and focus-ring styles. |
data-part | group | Child list; animates height while motion is allowed. |
data-state | checked | Selected item. |
data-state | open | Expanded branch trigger and group. |
data-state | closed | Collapsed branch trigger and group. |
data-themed | present | Present on every themed tree part. |
data-selected | present | Selected item and trigger. |
data-disabled | present | Disabled root, item, or trigger. |
data-animation | off | Group with disableAnimation. |
CSS variables
| Name | Description |
|---|---|
--ghost-tree-level | 1-based item depth (set inline by GhostTreeItem) that drives row indentation. |
--ghost-surface-muted-bg | Selected row background. |
--ghost-elevation-2-bg | Hovered row background. |
--ghost-space-inset-md | Indentation step per level. |
--ghost-focus-ring-color | Focus ring color on the focused item row. |
--ghost-motion-duration-moderate | Group expand/collapse duration. |
Accessibility
Role: tree. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/.
Required ARIA attributes: aria-label.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Tab | Moves focus into and out of the tree through its single roving tab stop. | Not reviewed |
ArrowDown | Moves focus to the next visible enabled item without changing selection; wraps only when loop is true. | Not reviewed |
ArrowUp | Moves focus to the previous visible enabled item without changing selection; wraps only when loop is true. | Not reviewed |
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. | Not reviewed |
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. | Not reviewed |
Home | Moves focus to the first visible enabled item. | Not reviewed |
End | Moves focus to the last visible enabled item. | Not reviewed |
Enter | Selects the focused item (single), deselects it when allowDeselect is true, or toggles it (multiple). Never toggles expansion. | Not reviewed |
| Same as Enter when no typeahead query is active; otherwise appends a space to the query. | Not reviewed |
* | Expands every closed enabled sibling branch of the focused item in one update. | Not reviewed |
a-z | Printable characters run a 500ms typeahead over visible enabled items, moving focus without selecting. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
tree/themed
Themed file tree with independent selection and expansion, separate chevrons, and a switch for RTL arrow navigation.
tree/roadmap-milestones
Milestones grouped by initiative with an Undated group, an example-owned timeline of target days, target windows and actual dates, and app-supplied risk details with a linked work item.