Range scrollbar preview
A generic controlled range window with draggable thumb and resize handles.
Installation
pnpm add @techsquidtv/canvas-timeline-reactnpm install @techsquidtv/canvas-timeline-reactyarn add @techsquidtv/canvas-timeline-reactbun add @techsquidtv/canvas-timeline-react- 1
Install the package.
The command above adds the React bindings and their package dependencies.
- 2
Import from the React entrypoint.
@techsquidtv/canvas-timeline-react/range-scrollbar - 3
Add the timeline styles.
Use the full stylesheet with shadcn-compatible tokens, or base.css when your app owns the visual theme.
Default visuals import '@techsquidtv/canvas-timeline-react/styles.css';Base geometry import '@techsquidtv/canvas-timeline-react/base.css';
Usage
import { useState } from 'react';import { RangeScrollbar } from '@techsquidtv/canvas-timeline-react/range-scrollbar';
export function ClipRangeScrollbar() { const [value, setValue] = useState({ start: 10, end: 45 });
return ( <RangeScrollbar.Root min={0} max={100} value={value} minSpan={5} onValueChange={setValue} > <RangeScrollbar.Thumb> <RangeScrollbar.Handle side="start" /> <RangeScrollbar.Handle side="end" /> </RangeScrollbar.Thumb> </RangeScrollbar.Root> );}Notes
RangeScrollbaris controlled-only: keep the visible range in React state and update it fromonValueChange.- The generic primitive uses caller-provided numeric units and has no TimelineEngine dependency.
- Import
@techsquidtv/canvas-timeline-react/styles.csswhen your app defines shadcn-compatible semantic tokens, orbase.csswhen supplying your own theme. useRangeScrollbaris a primitive hook imported from @techsquidtv/canvas-timeline-react/range-scrollbar, not from the timeline hooks subpath.
API Reference
Range Scrollbar
A generic controlled range-window scrollbar primitive with an optional hook API.
Exports
| Name | Reference | Description |
|---|---|---|
RangeScrollbar.Root | API reference | Controlled generic range scrollbar root. |
RangeScrollbar.Thumb | API reference | Draggable thumb representing the visible range window. |
RangeScrollbar.Handle | API reference | Resize handle for the start or end of the visible range. |
useRangeScrollbar | API reference | Primitive hook for custom range scrollbar geometry and range updates from the range-scrollbar entrypoint. |
Props and Inputs
| Name | Type | Description |
|---|---|---|
min | number | Lower bound of the full scrollable domain. |
max | number | Upper bound of the full scrollable domain. |
value | { start: number; end: number } | Controlled visible range in caller-defined domain units. |
minSpan | number | Smallest allowed span between value.start and value.end. |
onValueChange | (value, details) => void | Callback used to store the next controlled range. |
getAriaValueText | (value, details) => string | Optional formatter for thumb and handle aria-valuetext output. |
disabled | boolean | Disables pointer and keyboard interactions while keeping parts rendered. |
side | 'start' | 'end' | Resize handle side for RangeScrollbar.Handle. |