Skip to content
Noksha UIv0.1
Colour theme

forms

Slider

A draggable range control with full keyboard support and step snapping.

Examples

Value and steps

`formatValue` shapes both the visible number and the one `aria-valuetext` announces, so the two cannot disagree.

Arrow keys step by 1, Page Up and Page Down by 10.

Variants

All five `variant` values beside the same five in the `success` tone — `minimal` keeps the thumb hidden until hover or focus. Every tile copies on its own.

Default
Default · success
Solid
Solid · success
Soft
Soft · success
Outline
Outline · success
Minimal · hover for thumb
Minimal · success

Sizes

`size` from `xs` to `xl` with `showValue`, then the same scale paired with each `thumb` shape.

Scale

XS
SM
MD
LG
XL

Sizes with thumb shapes

XS · square
SM · bar
MD · pill
LG · square
XL · bar
XL · pill

Semantic tones

Six `tone` values across the `default`, `solid` and `soft` variants — fill, thumb and soft rail all come from the tone tokens.

Default variant

Accent · Default
Neutral · Default
Success · Default
Warning · Default
Danger · Default
Info · Default

Solid variant

Accent · Solid
Neutral · Solid
Success · Solid
Warning · Solid
Danger · Solid
Info · Solid

Soft variant

Accent · Soft
Neutral · Soft
Success · Soft
Warning · Soft
Danger · Soft
Info · Soft

Thumb shapes

`thumb` as circle, square, bar or pill across sizes and variants, then custom thumbs built from `--sl-thumb-w`, `--sl-thumb-bg` and `--sl-thumb-shadow` in `className`.

Shapes

Circle
Square
Bar
Pill

Across sizes and variants

Square · XL · solid
Bar · LG · soft
Pill · SM · outline
Circle · XS · solid
Bar · XL · outline
Pill · LG · soft

Custom with CSS variables

Wide flat key
Hollow ring
Big knob, thick track
Inset knob
Glow
Brutalist

Marks

`marks` as one tick per step, ticks at chosen values, or `{ value, label }` stops — with `tooltip`, `showValue` and on a `RangeSlider`.

Step ticks
Ticks at values
Labelled percentages
Named stops
Ticks with tooltip
Playback speed
Dense ticks with value
Range with marks

Tooltips

`tooltip` on hover, focus and drag, or pinned with `"always"`; `formatValue` turns the bubble into currency, a percentage, m:ss or °C and announces the same text.

On hover, focus and drag
Always visible
Currency
Percentage
Time · m:ss
Temperature
Soft · pill thumb
Solid · square thumb
Minimal · thumb and tooltip on hover
Range · always visible

Vertical

`orientation="vertical"` fills its parent’s height — an equalizer, a fader with `showValue`, labelled marks, a pinned tooltip and a track-only bar.

Equalizer · ±12 dB
60Hz
150Hz
400Hz
1k
2.4k
6k
14k
Volume fader
Labelled stops
Tooltip
Control-centre bar

Range slider

Two native range inputs over one track — `minStepsBetween` keeps them apart, `formatValue` shapes the label, tooltip and `aria-valuetext`, and `thumbLabels` names each thumb.

Price filter
Minimum gap of 20
Age range with tooltips
Time-of-day window
Discount tiers
Stepped levels
Minimal, thumbs on hover
Alert band
Invalid
Disabled

Bold styles

Sixteen looks built only from `className` and the `--sl-*` variables — neon, glass, iOS chunky, brutalist, striped, segmented and more, with no fork of the component. Copy any tile on its own.

Neon glow
Gradient fill
Sunset thick
iOS chunky
Glass
Hairline
Inverse slab
Square brutalist
Outline ring
Pill thumb, soft
Striped fill
Segmented rail
Retro pixel
HP
Candy pastel
Dotted rail
DAW faders
Kick
Snare
Bass
Keys
Vox

Media controls

A player card: a `minimal` scrubber with an m:ss tooltip and buffered fill, a volume slider whose icon follows the level, playback speed on marks, and stepper buttons for zoom.

PausedMonsoon StaticLumen Drift
1:11-2:23
64%
Playback speed
70%
100%

Colour sliders

Hue, saturation, lightness and alpha — a transparent `--sl-rail` lets each `--sl-fill-image` gradient show across the whole track, recomputed from the current colour.

#6c47ff
Hex#6c47ff
Rgbrgb(108 71 255)
Hslhsl(252 100% 64%)
252°
100%
64%
100%
Presets

Expressive scales

Satisfaction with a face that changes and a tone that follows, a thermostat on a cold-to-hot gradient, a spice level and a 0–10 effort scale with labelled marks.

Satisfaction
Good
Thermostat
Spice level
Pain scale
No painWorst imaginable

States

`disabled` and `invalid` on `Slider` and `RangeSlider`, plus `FieldRoot` wiring the label, description, required marker and error text.

Disabled
Disabled with value
Invalid
Invalid range
Invalid field with error

Above the $80k approved for this quarter.

Required with description

Seats are billed per active member.

Disabled range
Disabled field

Locked by your organisation’s data policy.

Controlled patterns

A number input with clamping, preset buttons, a reset, two sliders on one value, editable range bounds and an `onValueChange` log.

Slider and number input
Type 250 and press Enter — it clamps to 100.
Preset buttons
Reset to default
The button disables itself once the value is back at 0.
Two sliders, one value
zoom: 60
Range with editable bounds
$k per year
onValueChange log
  1. Drag the slider to log changes.

Forms

`name` posts the raw number, a range posts two values under one name, disabled controls drop out, and a threshold check drives `FieldRoot invalid`.

Managed plans start at $1,000 a month.

Both thumbs share one name, so it posts two values.

The form gets the raw hour, not the formatted label.

Disabled controls are left out of FormData.

Submitted FormData
Submit the form to see its entries.

Product filters

A real filter panel — a price histogram over a range, a marked rating floor and a distance tooltip, all feeding one live result count.

Filters

3 active

1,200 refurbished laptops from local sellers.

$200 – $900
3★ & up
Within 40 km

Pricing calculator

Seats, storage and billing period feed one live total — the storage slider walks an index so its labelled marks sit on a non-linear 10 GB to 1 TB scale.

Estimate your plan

Pay per seat, then add storage as your team grows.

Team
24 seats

Team at $10 per seat — SSO, shared projects and 90-day history.

100 GB

$15 a month on top of seats.

Save 20%

Billed once a year instead of every month.

Per month, billed annually$204$2,448 charged today
24 seats × $10
$240
Storage, 100 GB
$15
Annual discount
−$51
Total per month
$204

Mixer console

Vertical faders with `bar` thumbs and dB readouts — mute disables a channel, solo repaints the rest, and the master’s segmented `--sl-fill-image` turns `danger` past 0 dB.

Mix bus

Mute locks a channel's fader. Solo silences every channel that is not soloed.

Kick
Snare
Bass
Keys
Vocals
Master
OK

Reading settings

Four sliders writing straight into a live preview’s inline style — labelled marks on font size, `formatValue` on line height and tracking, and a contrast warning below 60%.

Reading view

Tune the text to your eyes. Every change previews instantly.

The quiet work of good type

When size, spacing and contrast suit the reader, the letters stop asking for attention and only the meaning is left. That is all these four controls are for — nudge them until the page disappears.

Wider spacing helps at small sizes.

How strongly text stands out from the page.

Using the default reading view.

Loan calculator

Amount, term and rate drive an amortised monthly payment and a principal-versus-interest bar, with the rate slider’s `tone` tracking how expensive the loan is getting.

Mortgage calculator

A fixed-rate loan, repaid in equal monthly instalments.

$420,000
30 years

Close to the typical fixed rate for this term.

Monthly payment$2,627.12360 payments at 6.4% APR
Principal
$420,000
Total interest
$525,765
Total cost
$945,765
Principal, 44% of what you repayInterest, 56%

Own the source

Noksha ships as a package and as copy-paste source. Take the files and they are yours to change. These are read from the generated registry, so they are exactly what the library ships — never a paraphrase of it.

Take these files, and field, internal helpers along with them — the imports below point at them. Or let the CLI do it: npx @noksha-ui/cli add slider writes them, follows the same dependency graph, and fixes up the imports.

export { RangeSlider, rangeSliderVariants, Slider, sliderVariants } from './slider.js';
export type {
  RangeSliderProps,
  SliderMark,
  SliderOrientation,
  SliderProps,
  SliderSize,
  SliderThumb,
  SliderTone,
  SliderTooltip,
  SliderVariant,
} from './slider.types.js';

API reference

Accepted values

SliderSize
xssmmdlgxl
SliderVariant
defaultsolidsoftoutlineminimal
SliderThumb
circlesquarebarpill
SliderOrientation
horizontalvertical
SliderTooltip
booleanalways

SliderMark

PropTypeDescription
value*number—
labelReact.ReactNode—

SliderProps

Also accepts everything from Omit< React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'defaultValue' | 'onChange' >.

PropTypeDescription
valuenumber—
defaultValuenumber—
onValueChange(value: number) => void—
minnumber—
maxnumber—
stepnumber—
sizeSliderSize—
toneSliderTone—
variantSliderVariant—
thumbSliderThumb—
orientationSliderOrientation—
invalidboolean—
showValuebooleanShow the current value beside the track.
tooltipSliderTooltip—
marksboolean | ReadonlyArray<number | SliderMark>—
formatValue(value: number) => stringFormats the displayed value, and the one announced by `aria-valuetext`.
containerClassNamestringClasses for the wrapper; `className` styles the track itself.

RangeSliderProps

Also accepts everything from Omit<React.HTMLAttributes<HTMLDivElement>, 'defaultValue' | 'onChange'>.

PropTypeDescription
value[number, number]—
defaultValue[number, number]—
onValueChange(value: [number, number]) => void—
minnumber—
maxnumber—
stepnumber—
minStepsBetweennumber—
sizeSliderSize—
toneSliderTone—
variantSliderVariant—
thumbSliderThumb—
invalidboolean—
disabledboolean—
namestring—
showValueboolean—
tooltipSliderTooltip—
marksboolean | ReadonlyArray<number | SliderMark>—
formatValue(value: number) => string—
thumbLabels[string, string]—