A wider screen, please

This page features interactive demos and side-by-side code samples that need at least 340 pixels of horizontal space. Please widen your browser window, or rotate your device, to continue.

Morpheus v0.1.0
v0.1.0

Slider range#

Component <neo-slider-range> is a two-handle slider picking a [min, max] range. The fill spans between the thumbs; each drags independently and is clamped against the other so the low handle can't pass the high handle. Clicking the rail moves the nearer thumb to the click point. Both endpoints have a contenteditable readout with the same number-only input filter as <neo-slider>.

Default
Decimal step
Dense mark labels
Negative range
Custom easing
Custom anchor + thumb
Vertical temperature
Bare rail (no header)
Disabled
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Reference#

Attributes #

NameTypeDefaultDescription
value-minnumber reflected observednoneLower bound. Normalized against value-max.
value-maxnumber reflected observednoneUpper bound.
minnumber observed0Lower bound.
maxnumber observed100Upper bound.
stepnumber observed1Increment between snap points.
labelstring observednonePlain-text caption.
unitstring observednonePlain-text suffix; rendered after the upper bound.
hide-valueboolean observedfalseSuppress the value-pair display.
hide-tooltipboolean observedfalseSuppress the hover bubbles.
verticalboolean observedfalseSwitch to vertical orientation.
disabledboolean observedfalseNon-interactive state.
static-marksboolean observedfalseMake marks non-interactive.
easingstring observednoneCSS transition shorthand for the thumbs.

States #

NameDescription
:state(dragging)Set while a pointer drag is in flight; suppresses the easing transition so the thumb tracks the cursor.

Slots #

NameDescription
[data-neo-slider-mark]Anchor mark at a numeric value, optionally with a label child.

Events #

NameDetailBubblesDescription
neo-slider-range-input{ min: number, max: number }yesFires on every value change during a pointer drag. Keyboard nav commits via change instead.
neo-slider-range-change{ min: number, max: number }yesFires when the interaction commits.

Parts #

NameDescription
::part(header)Row holding the label, output, and unit.
::part(label)Label text.
::part(output)Wrapper around the min value, separator, and max value.
::part(value-min)Editable lower-bound value field.
::part(value-max)Editable upper-bound value field.
::part(separator)Glyph between the two value fields.
::part(unit)Unit suffix after the values.
::part(track)The rail the thumbs travel along.
::part(fill)Painted segment between the two thumbs.
::part(thumb-min)Lower-bound drag handle.
::part(thumb-max)Upper-bound drag handle.
::part(marks)Container for anchor-mark labels below the track.

Examples#

Decimal step#

step="0.1" snaps both values to one decimal place. The . key is allowed in the value fields because the step is non-integer. Marks show the dB scale's reference points; the active range lights up the marks it covers.

−∞ 1 2 3 4 5

Dense mark labels#

Labels that overlap or sit less than 1ch apart collapse automatically. Hover a hidden label to reveal it. When both active extremes compete for the same space, the label closest to either thumb stays visible. Equal distances prefer the high label; hover or focus the lower thumb to prefer the low label instead.

Backlog Discovery Definition Development Verification Released

Negative range#

When min is below zero both value fields accept a leading -. Useful for symmetric ranges like time offsets or pan positions.

Custom easing#

Set easing to animate the thumbs and fill between committed values. Click the rail or nudge with the keyboard to see the transition; dragging still tracks the pointer directly.

Vertical temperature#

Set vertical to rotate the layout. The low value sits at the bottom and the high value at the top; pointer dragging follows the vertical rail. Marks light up when the active range covers them.

Cold Freezing Comfort Warm Hot

Bare rail (no header)#

Omit label and set hide-value to drop the entire header row. The thumbs still focus on Tab and the value bubbles still pop on hover/press, so the control stays operable.

Disabled#

Pointer and keyboard input are ignored, the thumbs leave the tab order, and the host gets a 50% opacity overlay.

Custom anchor + thumb#

Like the single slider, a <template data-neo-slider-anchor> and <template data-neo-slider-thumb> are cloned into every dot and into both thumbs. Here the range picks a span of star ratings: each anchor is an outline <neo-icon name="star"> that becomes a filled accent dot while it sits inside the selected band, and both thumbs are filled stars. The cloned glyph is a shadow boundary too deep for page CSS to restyle, so an active anchor paints its dot from its own masked background.

Examples: Datastar#

Morphing during interaction#

A Datastar app can fat-morph the page at any moment, and a server narrowing or widening the band just re-emits the range with new value-min / value-max attributes. The rail, both thumbs, and the fill live in the component's shadow root, so a morph of the bare light host only changes those two attributes and never touches the thumb or fill nodes, so the easing transition eases the band to its new bounds. Autoplay cycles the states below, with no signals or morph hints, and the band glides from Low to Medium to High just the same.

Low
Medium
High
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator