Skip to content

GhostSlider ​

GhostSlider is a range input with WAI-ARIA slider semantics. It supports single values and optional two-thumb intervals, native form participation through hidden inputs, and horizontal or vertical orientation. Keyboard support follows the APG Slider pattern (arrows, Page Up/Down, Home, End). Import it from @ghostvue/themes for the track, fill and thumb recipes. To paint the parts yourself, see Advanced: headless composition.

Export mastering

Single, range, and disabled GhostSlider controls with live value readouts.

Export mastering

Tune output gain and passband filter before rendering the stem.

Master output 72%
Passband frequency (Hz) 250 Hz – 1400 Hz
minimummaximum
Safety limiter (locked) 90%

The mastering panel composes themed GhostSlider controls from @ghostvue/themes inside GhostCard: a single-thumb gain, a two-thumb passband range, and a disabled limiter, each with a live readout in its unit.

Value text and units ​

A slider's number means little without its unit. Show the value next to the label, as the readouts above do, and pass value-text so assistive technology hears the same thing: the master output thumb announces "72 percent" through aria-valuetext instead of a bare 72. value-text applies to single-thumb sliders only. In range mode, put the unit in the label instead, as the passband does with "Passband frequency (Hz)".

Filter by a range ​

Price filter

Two-thumb nightly price range in USD with a live count of matching stays.

Filter stays

Nightly price (USD) $80 – $240 per night
minimummaximum

Enable range and bind v-model to a two-number tuple. Each thumb is its own role="slider" named from the root label plus "minimum" or "maximum", and each keeps the interval valid: the low thumb's aria-valuemax follows the high thumb's value, so the thumbs never cross. Tab to a thumb and use the arrow keys to move it one step, Page Up / Page Down for larger jumps, and Home / End to go as far as the thumb can: End on the low thumb stops at the high thumb. name and nameMax submit both ends with a form.

Vertical orientation ​

The themed wrapper adds track, fill, and thumb recipes via size and tone. Track and fill share --ghost-track-thickness-* (4 / 6 / 8px) and the thumb uses --ghost-track-thumb-* (12 / 16 / 20px) at every density and theme. Transparent hit areas grow the track and thumb to at least --ghost-track-target (24px) without changing layout or the focus ring.

Vertical themed

Themed vertical orientation and tokens.

Gain 60%

With orientation="vertical", Arrow Up increases the value and Arrow Down decreases it.

Width ​

A horizontal themed slider fills a GhostField and is 12rem wide elsewhere, such as in a toolbar or a table cell, following the form control width rule. Set inline-size through class or style to choose another width. A vertical slider keeps the headless 12rem height.

Accessibility ​

Provide an accessible name on the root (aria-label or aria-labelledby). In range mode, each thumb is its own slider with constrained min/max. Arrow keys adjust the focused thumb; RTL flips horizontal arrows. See slider-spec.md for the full contract.

Advanced: headless composition ​

For teams that bring their own design system, the headless GhostSlider from @ghostvue/vue positions the rail, range and thumbs but paints nothing. Each example below carries the consumer CSS it needs, using system colors so it works without a theme.

Basic use ​

Single value Headless

Headless numeric slider with stepped values.

35 credits

Headless range ​

Range filter Headless

Two-thumb interval selection for tables.

From 25 to 75

The slider/value-text example on the reference page shows value-text on a headless single-thumb slider.

API ​

PropTypeDefaultDescription
defaultValueGhostSliderValue—Uncontrolled seed and form-reset baseline.
disabledbooleanfalseNon-operable; hidden inputs not submitted.
formstring—External form association.
maxnumber100Upper bound.
messagesGhostSliderMessages—Overridable range-thumb naming strings (minimum, maximum) and aria-label formatters (formatMinimumLabel, formatMaximumLabel).
minnumber0Lower bound.
modelValueGhostSliderValue—Controlled value; tuple when range is true.
namestring—Primary hidden field name.
nameMaxstring—High thumb name when range is true.
orientation'horizontal' | 'vertical'"horizontal"Axis and keyboard mapping.
rangebooleanfalseTwo-thumb interval mode.
stepnumber1Snap increment.
valueTextstring—aria-valuetext for single-thumb mode.
SlotSlot propsDescription
default—Optional inner content. Prefer aria-labelledby or an external label.

@ghostvue/themes adds these to the headless GhostSlider API, which it forwards:

PropTypeDefaultDescription
tone'accent' | 'neutral' | 'danger'"accent"Semantic color intent for the range fill and thumb ring.
size'sm' | 'md' | 'lg'"md"Track thickness and thumb diameter.

Native attributes (id, class, aria-labelledby, and listeners) fall through to the root (data-part="root"). Thumbs expose role="slider" with aria-valuenow / aria-valuemin / aria-valuemax.

Template ref ​

GhostSliderExposed provides element, value, focus(), and blur().