Skip to content

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.

All component references

Props ​

NameTypeDefaultRequiredDescription
allowDeselectbooleanfalseNoIn single mode, re-activating the selected node clears the selection. Forwarded to headless GhostTree.
asGhostTreeElement"ul"NoTag name or component rendered for the `role="tree"` container. Forwarded to headless GhostTree.
defaultExpandedstring[]"[]"NoInitial expanded branch values when `expanded` is omitted. Forwarded to headless GhostTree.
defaultValueGhostTreeValue—NoInitial uncontrolled selection. Forwarded to headless GhostTree.
dirGhostTreeDirection—NoExplicit writing direction; otherwise inherited from `[dir]`. Forwarded to headless GhostTree.
disabledbooleanfalseNoDisables every interaction in the tree. Forwarded to headless GhostTree.
expandedstring[]—NoControlled expanded branch values (`v-model:expanded`). Forwarded to headless GhostTree.
expandOnClickbooleantrueNoPointer clicks on a branch row also toggle expansion. Forwarded to headless GhostTree.
loopbooleanfalseNo`ArrowDown` / `ArrowUp` wrap at the ends of the visible node list. Forwarded to headless GhostTree.
modelValueGhostTreeValue—NoControlled selection (`v-model`). Omit for uncontrolled mode. Forwarded to headless GhostTree.
selectionModeGhostTreeSelectionMode"single"NoSingle (`string | undefined`) or multiple (`string[]`) selection. Forwarded to headless GhostTree.

Emits ​

NamePayloadDescription
selectGhostTreeSelectPayloadEmitted as `select`.
toggleGhostTreeTogglePayloadEmitted as `toggle`.

Models ​

PropEventTypeDescription
expandedupdate:expandedstring[]v-model binding for `expanded`.
modelValueupdate:modelValueGhostTreeValuev-model binding for `modelValue`.

Slots ​

NameDescription
defaultGhostTreeItem nodes; receives selection, expansion, and focus state plus select/toggle helpers.

Slot props: default ​

NameTypeDescription
expandAllSiblings(value: string) => voidSlot prop `expandAllSiblings`.
expandedstring[]Slot prop `expanded`.
focusedValuestring | undefinedSlot prop `focusedValue`.
isExpanded(value: string) => booleanSlot prop `isExpanded`.
isSelected(value: string) => booleanSlot prop `isSelected`.
modelValueGhostTreeValueSlot prop `modelValue`.
select(value: string) => voidSlot prop `select`.
toggleExpanded(value: string) => voidSlot prop `toggleExpanded`.

Exposed members ​

NameTypeDescription
blur() => voidExposed method `blur`.
elementHTMLElement | nullExposed property `element`.
focus(options?: FocusOptions) => voidFocuses the current roving tab stop item, if any.

Parts and data attributes ​

AttributeValueDescription
data-partrootTree container with data-themed.
data-partitemTree item; indents from --ghost-tree-level.
data-parttriggerItem row: hover, selected, disabled, and focus-ring styles.
data-partgroupChild list; animates height while motion is allowed.
data-statecheckedSelected item.
data-stateopenExpanded branch trigger and group.
data-stateclosedCollapsed branch trigger and group.
data-themedpresentPresent on every themed tree part.
data-selectedpresentSelected item and trigger.
data-disabledpresentDisabled root, item, or trigger.
data-animationoffGroup with disableAnimation.

CSS variables ​

NameDescription
--ghost-tree-level1-based item depth (set inline by GhostTreeItem) that drives row indentation.
--ghost-surface-muted-bgSelected row background.
--ghost-elevation-2-bgHovered row background.
--ghost-space-inset-mdIndentation step per level.
--ghost-focus-ring-colorFocus ring color on the focused item row.
--ghost-motion-duration-moderateGroup expand/collapse duration.

Accessibility ​

Role: tree. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/treeview/.

Required ARIA attributes: aria-label.

Keyboard ​

KeyActionAutomated browser test
TabMoves focus into and out of the tree through its single roving tab stop.Not reviewed
ArrowDownMoves focus to the next visible enabled item without changing selection; wraps only when loop is true.Not reviewed
ArrowUpMoves focus to the previous visible enabled item without changing selection; wraps only when loop is true.Not reviewed
ArrowRightLTR: 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
ArrowLeftLTR: 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
HomeMoves focus to the first visible enabled item.Not reviewed
EndMoves focus to the last visible enabled item.Not reviewed
EnterSelects 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-zPrintable 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.

CategoryStatusEvidence
Automated keyboardNot reviewedNo declared key is mapped to a browser test yet.
Manual interactionNot reviewedNo review recorded.
Assistive technologyNot reviewedNo review recorded.

Examples ​

tree/themed ​

Example source

Workspace explorer

Themed file tree with independent selection and expansion, separate chevrons, and a switch for RTL arrow navigation.

Workspace explorer
  • Components
    • Button
    • Tree
  • Tokens
Selected: components/tree

tree/roadmap-milestones ​

Example source

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.

Milestones by initiative
  • Reporting, 3 milestones
    • CSV export, At risk, Target: June 12
    • Scheduled reports, On track, Target window: July 1 – July 31
    • Undated, 1 milestone
      • Report sharing permissions, Needs a date, No target date
  • Billing, 3 milestones
    • Invoice PDF redesign, Completed, Target: June 12, Actual: June 15
    • Usage dashboard beta, Completed, Target window: July 1 – July 31, Actual: July 18
    • Tax ID validation, On track, Target: August 20
Milestone details Choose a milestone in the tree or on the timeline to see its target, status and linked work.
Timeline, June – August 2026
Reporting
Billing