Visual tone for the active fill + thumb. Default: 'cyan'.
showMinMax
boolean
false
Render min / max numbers under the track.
surface
'pixel' | 'linear'
—
Surface variant. Inherits from PxlKitSurfaceProvider when omitted.
name
string
—
Form-serialization name (range mode emits name[0] / name[1]).
required
boolean
—
Marks the field as required for native form validation.
id
string
—
DOM id forwarded to the single / lower thumb.
marks
PixelSliderMark[]
—
Labeled marks plotted on the track.
showTooltip
'always' | 'drag' | 'never'
'never'
When/how to show a value tooltip on each thumb. - 'always': visible all the time - 'drag': visible while dragging or focused - 'never': hidden (default)
ticks
boolean
false
Render tick marks under the track for every discrete step.
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
slider
Each thumb is rendered with role="slider" and exposes aria-valuemin, aria-valuemax, aria-valuenow, and an accessible label derived from the label prop. In range mode the lower thumb is constrained ≤ upper thumb on every change. Pointer interaction uses setPointerCapture so dragging tracks the cursor even when it leaves the track.
Keyboard
Key
Action
When
ArrowRight / ArrowUp
Increment the focused thumb by step.
—
ArrowLeft / ArrowDown
Decrement the focused thumb by step.
—
Home
Jump the focused thumb to min.
—
End
Jump the focused thumb to max.
—
PageUp
Increment the focused thumb by step * 10.
—
PageDown
Decrement the focused thumb by step * 10.
—
Tab
Move focus to the next thumb or focusable element.
—
Usage
import { useState } from 'react';
import { PixelSlider } from '@pxlkit/ui-kit';
export function Default() {
const [value, setValue] = useState(40);
return (
<PixelSlider
label="Volume"
value={value}
onChange={setValue}
/>
);
}
Examples
Default
import { useState } from 'react';
import { PixelSlider } from '@pxlkit/ui-kit';
export function Default() {
const [value, setValue] = useState(40);
return (
<PixelSlider
label="Volume"
value={value}
onChange={setValue}
/>
);
}