Header row
RequiredPersistent label and optional formatted output.
Fields & selection
A controlled native range input for choosing a numeric value from a bounded continuum.
SliderSliderPropsConfigure the production component, inspect it at responsive widths, copy synchronized JSX, and share the exact state from one workspace.
This JSX stays synchronized with the controls and uses only public package APIs.
'use client';
import { useState } from 'react';
import { Slider } from '@ai-created/ui';
export function Example() {
const [value, setValue] = useState(50);
return (
<Slider
label="Completion"
value={value}
onChange={setValue}
/>
);
}
import { Slider } from '@ai-created/ui';Replace the version placeholder with the release tag your product has reviewed.
npm install --install-links "git+https://github.com/TheMarco/ai-created-ui.git#vX.Y.Z"@import '@ai-created/ui/styles/tokens.css';
@tailwind base;
@tailwind components;
@tailwind utilities;module.exports = {
presets: [require('@ai-created/ui/tailwind-preset')],
content: [
'./src/**/*.{js,ts,jsx,tsx,mdx}',
'./node_modules/@ai-created/ui/src/**/*.{js,ts,jsx,tsx}',
],
};Named regions define what belongs to the component, what remains optional, and where semantic responsibility lives.
Persistent label and optional formatted output.
Accessible range name.
labelOptional formatted current value.
output6px range with filled progress.
22px draggable value handle.
The Figma-equivalent asset model, auto-layout, resizing, properties, slots, content bounds, localization, and governance contract.
Asset kind
component
Design library name
Components/Forms/Slider
Maturity
stable
Last reviewed
2026-08-29
Canvas applicability
Publish value, disabled, and value-label properties with a number property for the thumb position.
| Property | Type | Default | Code mapping | Options or notes |
|---|---|---|---|---|
| ValueRequired | number | 50 | value | No additional constraint |
| Minimum | number | 0 | min | No additional constraint |
| Maximum | number | 100 | max | No additional constraint |
| Step | number | 1 | step | No additional constraint |
| Show value | boolean | true | showValue | No additional constraint |
| Disabled | boolean | false | disabled | No additional constraint |
| LabelRequired | text | Value | label | No additional constraint |
Label and optional formatted value.
Internal label/value elementsNative range control and focus target.
<input type="range">CSS-painted current value representation.
Internal range stylingOverflow: Wrap only when required by localization.
The adjusted quantity should be immediately clear.
Overflow: Use compact localized formatting.
Long prose does not belong in the value slot.
Translatable: Label, Formatted value and unit
Track fills its form column.
No internal breakpoint
Accountable owner
Design systems form foundations owner
Canonical source: src/components/Slider.tsx
These measurements and semantic tokens define the supported visual contract. Local overrides should preserve the same hierarchy and interaction cues.
Interaction row minimum height
44px
Track height
6px
Thumb
22 × 22px
Thumb border
2px
Label/track gap
8px
Hover thumb scale
1.15×
--color-action-primaryProgress fill and thumb.
--color-surface2Unfilled track.
--color-control-borderTrack boundary.
--color-bgThumb border separation.
--color-focusRange focus outline.
A component is not complete until its passive, interactive, disabled, and exceptional states remain understandable in both themes.
Semantics, accessible naming, keyboard behavior, focus and announcements are implementation requirements, not optional documentation.
Use the public package API and preserve the controlled-state, native-attribute, and ref contracts described below.
import { Slider } from '@ai-created/ui';Server Component compatible
<Slider label="Opacity" value={opacity} onChange={setOpacity} formatValue={(v) => `${v}%`} />These props and helpers are compatibility contracts. Changes require migration guidance and release notes.
| Prop | Type | Default | Contract |
|---|---|---|---|
| value | number | required | Controlled numeric value. |
| onChange | (value: number) => void | required | Called with the new value. |
| label | string | required | Accessible label. |
| min | number | 0 | Minimum value. |
| max | number | 100 | Maximum value. |
| step | number | 1 | Increment. |
| showValue | boolean | true | Shows formatted value. |
| formatValue | (value: number) => string | String(value) | Formats the displayed value. |
These rules keep the component recognizable across products without preventing deliberate composition.
The component should be verified as rendered UI, an interaction model, an accessibility surface, and a theme-aware visual artifact.