Skip to content
fayeuiStatic / 0.1.0
LLMs
API / Static edition

@fayegram-ai/faye-ui/controls/slider

Public exports and dependency-resolved component properties, with usage and rendering guidance.

Import

import { Slider } from '@fayegram-ai/faye-ui/controls/slider';

Usage and behavior guide · API JSON

This entry declares a client boundary. Follow the rendering guide for framework integration.

Public exports

NameKindResolved declaration type
SliderRootPropstypeSliderRootProps<Value>
SliderMarktypeSliderMark
DiscreteSliderPropstypeDiscreteSliderProps<Value>
Slidervalue{ readonly Root: typeof Root; readonly DiscreteRoot: typeof DiscreteRoot; readonly Marks: { (input: HTMLAttributes<HTMLDivElement> & { marks: readonly SliderMark[]; } & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefined; }): import("react").ReactElement; displayName: string; }; readonly Control: { (input: Omit<import("@base-ui/react").SliderControlProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/fa… (full type in API JSON)

Slider

Public component; use the linked family guide for complete composition and behavior.

Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.

Slider.Root

PropertyRequiredTypeMeaning
classNameNostring | ((state: SliderRootState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
defaultValueNoValue | undefinedThe uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead.
disabledNoboolean | undefinedWhether the slider should ignore user interaction.
formNostring | undefinedIdentifies the form that owns the slider inputs. Useful when the slider is rendered outside the form.
formatNoIntl.NumberFormatOptions | undefinedOptions to format the value.
formatValueNo((value: number) => string) | undefinedSee the usage contract and declaration.
interactionNoInteractionOptions | undefinedSee the usage contract and declaration.
largeStepNonumber | undefinedThe granularity with which the slider can step through values when using Page Up/Page Down or Shift + Arrow Up/Arrow Down.
localeNoIntl.LocalesArgumentThe locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
maxNonumber | undefinedThe maximum allowed value of the slider. Should not be equal to min.
minNonumber | undefinedThe minimum allowed value of the slider. Should not be equal to max.
minStepsBetweenValuesNonumber | undefinedThe minimum steps between values in a range slider.
nameNostring | undefinedIdentifies the field when a form is submitted.
onValueChangeNo((value: Value extends number ? number : Value, eventDetails: SliderRoot.ChangeEventDetails) => void) | undefinedCallback function that is fired when the slider's value changed. Receives the new value as the first argument; the originating event is available as eventDetails.event. The value is also reflected on eventDetails.event.target.value for form integration. The eventDetails.reason indicates what triggered the change: - 'input-change' when the hidden range input emits a change event (for example, via form integration) - 'track-press' when the control track is pressed - 'drag' while dragging a thumb - 'keyboard' for keyboard input - 'none' when the change is triggered without a specific interaction
onValueCommittedNo((value: Value extends number ? number : Value, eventDetails: SliderRoot.CommitEventDetails) => void) | undefinedCallback function that is fired when a value change is committed. Does not fire if the value did not change, or if the change was canceled. Warning: This is a generic event, not a change event. The eventDetails.reason indicates what triggered the commit: - 'drag' while dragging a thumb - 'track-press' when the control track is pressed - 'keyboard' for keyboard input - 'input-change' when the hidden range input emits a change event (for example, via form integration) - 'none' when the commit occurs without a specific interaction
orientationNoOrientation | undefinedThe component orientation.
refNoRef<HTMLDivElement> | undefinedAllows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderRootState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
scaleNo((value: number) => number) | undefinedTransform displayed/announced values while retaining raw values for forms and positioning.
stepNonumber | undefinedThe granularity with which the slider can step through values. (A "discrete" slider.) The min prop serves as the origin for the valid values. We recommend (max - min) to be evenly divisible by the step.
styleNoCSSProperties | ((state: SliderRootState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
thumbAlignmentNo"center" | "edge" | "edge-client-only" | undefinedHow the thumb(s) are aligned relative to Slider.Control when the value is at min or max: - center: The center of the thumb is aligned with the control edge - edge: The thumb is inset within the control such that its edge is aligned with the control edge - edge-client-only: Same as edge but renders after React hydration on the client, reducing bundle size in return
thumbCollisionBehaviorNo"push" | "none" | "swap" | undefinedControls how thumbs behave when they collide during pointer interactions. - 'push' (default): Thumbs push each other without restoring their previous positions when dragged back. - 'swap': Thumbs swap places when dragged past each other. - 'none': Thumbs cannot move past each other; excess movement is ignored.
valueNoValue | undefinedThe value of the slider. For range sliders, provide an array with one value per thumb.
variantsNo{ readonly tone?: VisualVariant<"slider", "tone"> | undefined; readonly size?: VisualVariant<"slider", "size"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.DiscreteRoot

PropertyRequiredTypeMeaning
allowedValuesYesreadonly number[]See the usage contract and declaration.
classNameNostring | ((state: SliderRootState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
defaultValueNoValue | undefinedThe uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead.
disabledNoboolean | undefinedWhether the slider should ignore user interaction.
formNostring | undefinedIdentifies the form that owns the slider inputs. Useful when the slider is rendered outside the form.
formatNoIntl.NumberFormatOptions | undefinedOptions to format the value.
formatValueNo((value: number) => string) | undefinedSee the usage contract and declaration.
interactionNoInteractionOptions | undefinedSee the usage contract and declaration.
largeStepNonumber | undefinedThe granularity with which the slider can step through values when using Page Up/Page Down or Shift + Arrow Up/Arrow Down.
localeNoIntl.LocalesArgumentThe locale used by Intl.NumberFormat when formatting the value. Defaults to the user's runtime locale.
minStepsBetweenValuesNonumber | undefinedThe minimum steps between values in a range slider.
nameNostring | undefinedIdentifies the field when a form is submitted.
onValueChangeNo((value: Value extends number ? number : Value, eventDetails: SliderRoot.ChangeEventDetails) => void) | undefinedCallback function that is fired when the slider's value changed. Receives the new value as the first argument; the originating event is available as eventDetails.event. The value is also reflected on eventDetails.event.target.value for form integration. The eventDetails.reason indicates what triggered the change: - 'input-change' when the hidden range input emits a change event (for example, via form integration) - 'track-press' when the control track is pressed - 'drag' while dragging a thumb - 'keyboard' for keyboard input - 'none' when the change is triggered without a specific interaction
onValueCommittedNo((value: Value extends number ? number : Value, eventDetails: SliderRoot.CommitEventDetails) => void) | undefinedCallback function that is fired when a value change is committed. Does not fire if the value did not change, or if the change was canceled. Warning: This is a generic event, not a change event. The eventDetails.reason indicates what triggered the commit: - 'drag' while dragging a thumb - 'track-press' when the control track is pressed - 'keyboard' for keyboard input - 'input-change' when the hidden range input emits a change event (for example, via form integration) - 'none' when the commit occurs without a specific interaction
orientationNoOrientation | undefinedThe component orientation.
refNoRef<HTMLDivElement> | undefinedAllows getting a ref to the component instance. Once the component unmounts, React will set ref.current to null (or call the ref with null if you passed a callback ref).
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderRootState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
scaleNo((value: number) => number) | undefinedTransform displayed/announced values while retaining raw values for forms and positioning.
styleNoCSSProperties | ((state: SliderRootState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
thumbAlignmentNo"center" | "edge" | "edge-client-only" | undefinedHow the thumb(s) are aligned relative to Slider.Control when the value is at min or max: - center: The center of the thumb is aligned with the control edge - edge: The thumb is inset within the control such that its edge is aligned with the control edge - edge-client-only: Same as edge but renders after React hydration on the client, reducing bundle size in return
valueNoValue | undefinedThe value of the slider. For range sliders, provide an array with one value per thumb.
variantsNo{ readonly tone?: VisualVariant<"slider", "tone"> | undefined; readonly size?: VisualVariant<"slider", "size"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Marks

PropertyRequiredTypeMeaning
marksYesreadonly SliderMark[]See the usage contract and declaration.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Control

PropertyRequiredTypeMeaning
classNameNostring | ((state: SliderControlState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderControlState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SliderControlState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Track

PropertyRequiredTypeMeaning
classNameNostring | ((state: SliderTrackState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderTrackState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SliderTrackState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Indicator

PropertyRequiredTypeMeaning
classNameNostring | ((state: SliderIndicatorState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderIndicatorState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SliderIndicatorState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Thumb

PropertyRequiredTypeMeaning
aria-valuetextNostring | undefinedA string value forwarded to the `aria-valuetext` attribute of the input. Ignored when getAriaValueText is provided.
classNameNostring | ((state: SliderThumbState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
disabledNoboolean | undefinedWhether the thumb should ignore user interaction.
getAriaLabelNo((index: number) => string) | null | undefinedA function which returns a string value for the `aria-label` attribute of the input.
getAriaValueTextNo((formattedValue: string, value: number, index: number) => string) | null | undefinedA function which returns a string value for the `aria-valuetext` attribute of the input. This is important for screen reader users.
indexNonumber | undefinedThe index of the thumb which corresponds to the index of its value in the value or defaultValue array. This prop is required to support server-side rendering for range sliders with multiple thumbs.
inputRefNoRef<HTMLInputElement> | undefinedA ref to access the nested input element.
onBlurNoFocusEventHandler<HTMLInputElement> | undefinedA blur handler forwarded to the input.
onFocusNoFocusEventHandler<HTMLInputElement> | undefinedA focus handler forwarded to the input.
onKeyDownNoKeyboardEventHandler<HTMLInputElement> | undefinedA keydown handler forwarded to the input.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderThumbState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SliderThumbState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
tabIndexNonumber | undefinedOptional tab index attribute forwarded to the input.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Slider.Value

PropertyRequiredTypeMeaning
childrenNo((formattedValues: readonly string[], values: readonly number[]) => React.ReactNode) | null | undefinedSee the usage contract and declaration.
classNameNostring | ((state: SliderValueState) => string | undefined) | undefinedCSS class applied to the element, or a function that returns a class based on the component's state.
renderNoReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SliderValueState> | undefinedAllows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
styleNoCSSProperties | ((state: SliderValueState) => React.CSSProperties | undefined) | undefinedStyle applied to the element, or a function that returns a style object based on the component's state.
variantsNo{ readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"slider", "tone"> | undefined; } | undefinedSee the usage contract and declaration.

Defaults and customization

Descriptor defaults: {"size":"md","tone":"neutral"}. Parts: root, control, track, indicator, thumb, value, marks. Explicit instance props take precedence over configured defaults.

Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.

State, events and accessibility

For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.

Declaration authority

Generated from packages/faye-ui/dist/controls/slider.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.