Signature
useTimelinePanControl(options: TimelinePanControlOptions = {}): objectParameters
| Name | Type | Description |
|---|---|---|
| options | TimelinePanControlOptions | Optional scroll bounds, step size, label, and commit callback. |
Returns
object
Current scroll offset, formatted value text, imperative setters, and props for `Slider.Root` plus `Slider.Thumb`.
Return members
| Name | Signature | Description |
|---|---|---|
commit | (nextValue: number = control.value): void | Sets horizontal scroll offset and settles the engine interaction. |
getAriaValueText | (value: number): string | Formats a scroll offset value for `aria-valuetext`. |
label | label: string | Accessible label used by the default thumb props. |
max | max: number | Maximum scroll offset in pixels. |
min | min: number | Minimum scroll offset in pixels. |
rootProps | rootProps: object | Props for a Base UI `Slider.Root`. |
setValue | (nextValue: number): void | Sets horizontal scroll offset without an additional explicit commit callback. |
step | step: number | Slider step in pixels. |
thumbProps | thumbProps: { aria-label: string; aria-valuetext: string } | Props for a Base UI `Slider.Thumb`. |
value | value: number | Current horizontal scroll offset in pixels. |
valueText | valueText: string | Formatted pan value for assistive technology. |
Examples
const pan = useTimelinePanControl({ step: 40 });
return ( <Slider.Root {...pan.rootProps}> <Slider.Control> <Slider.Track> <Slider.Indicator /> <Slider.Thumb {...pan.thumbProps} /> </Slider.Track> </Slider.Control> </Slider.Root>);