Function

useTimelineInOutRangeControl

Adapts timeline In/Out points to a Base UI-compatible range slider. The hook keeps loop or export boundaries in sync with `TimelineEngine` `inPoint` and `outPoint` values while returning semantic labels and `aria-valuetext` strings for each thumb. `Timeline.RangeSelector.Root` uses this hook internally; consumers can call it directly when composing their own Base UI slider surface.

Signature

Type Definition
useTimelineInOutRangeControl(options: TimelineInOutRangeControlOptions = {}): object

Parameters

NameTypeDescription
optionsTimelineInOutRangeControlOptionsOptional bounds, step size, thumb labels, and commit callback.

Returns

object

Current In/Out values in seconds, formatted range text, engine commands, and props for range slider root and thumbs.

Return members

NameSignatureDescription
clear(): voidClears both In and Out points.
commit(nextValue: [number, number] = control.value): voidUpdates In/Out points and settles the engine interaction.
getAriaValueText(nextValue: number): stringFormats a timeline second value for `aria-valuetext`.
inThumbPropsinThumbProps: { aria-label: string; aria-valuetext: string }Props for the Base UI thumb controlling the In point.
inValueTextinValueText: stringFormatted in-point value for assistive technology.
maxmax: numberMaximum timeline boundary time in seconds.
minmin: numberMinimum timeline boundary time in seconds.
outThumbPropsoutThumbProps: { aria-label: string; aria-valuetext: string }Props for the Base UI thumb controlling the Out point.
outValueTextoutValueText: stringFormatted out-point value for assistive technology.
rootPropsrootProps: objectProps for a Base UI `Slider.Root`.
setValue(nextValue: number[], eventDetails?: RangeChangeDetails): voidUpdates In/Out points from second values without settling history.
stepstep: numberSlider step in seconds.
valuevalue: [number, number]Current `[inPoint, outPoint]` values in seconds.
valueTextvalueText: stringFormatted range summary for assistive technology.

Examples

tsx Example
const range = useTimelineInOutRangeControl();
return (
<Slider.Root {...range.rootProps}>
<Slider.Control>
<Slider.Track>
<Slider.Indicator />
<Slider.Thumb index={0} {...range.inThumbProps} />
<Slider.Thumb index={1} {...range.outThumbProps} />
</Slider.Track>
</Slider.Control>
</Slider.Root>
);