Skip to content

GhostSegmentedControl reference ​

Package: @ghostvue/vue. Status: experimental (stability policy).

Headless single-select segmented control with sliding indicator CSS variables and toggle-group roving focus.

Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.

All component references

Props ​

NameTypeDefaultRequiredDescription
asGhostSegmentedControlElement"div"NoRoot host element.
defaultValueGhostSegmentedControlValue—NoInitial selection when `modelValue` is omitted.
deselectablebooleanfalseNoWhen false, pressing the active segment keeps it selected (default view switching).
dir'ltr' | 'rtl'—NoExplicit text direction for horizontal roving.
disabledbooleanfalseNoDisables every item.
modelValueGhostSegmentedControlValue—NoControlled selection.
orientation'horizontal' | 'vertical'"horizontal"NoArrow-key roving layout and indicator slide axis.

Emits ​

None declared.

Models ​

PropEventTypeDescription
modelValueupdate:modelValueGhostSegmentedControlValuev-model binding for `modelValue`.

Slots ​

NameDescription
defaultSegment items.

Slot props: default ​

None declared.

Exposed members ​

NameTypeDescription
blur() => voidExposed method `blur`.
elementHTMLElement | nullExposed property `element`.
focus(options?: FocusOptions) => voidExposed method `focus`.

Parts and data attributes ​

AttributeValueDescription
data-partrootGroup host with indicator CSS variables.
data-partindicatorDecorative sliding thumb; aria-hidden.
data-statedisabledGroup-level disabled via aria-disabled.

CSS variables ​

NameDescription
--ghost-segmented-item-countRegistered item count for indicator geometry.
--ghost-segmented-selected-indexZero-based index of the pressed item.

Accessibility ​

Role: group. APG pattern: https://www.w3.org/WAI/ARIA/apg/patterns/button/.

Required ARIA attributes: aria-label, aria-labelledby.

Keyboard ​

KeyActionAutomated browser test
ArrowLeftPrevious enabled item (horizontal).Not reviewed
ArrowRightNext enabled item (horizontal).Not reviewed
ArrowUpPrevious enabled item (vertical).Not reviewed
ArrowDownNext enabled item (vertical).Not reviewed
HomeFirst enabled item.Not reviewed
EndLast enabled item.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 ​

segmented-control/basic ​

Example source

Segmented control Headless

Single-select view switcher with sliding indicator vars.

segmented-control/themed ​

Example source

Segmented control themed

Token-driven thumb with reduced-motion support.