Playhead preview
A scrub lane with the playhead line and grabber separated from editor chrome.
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 - 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 { Timeline } from '@techsquidtv/canvas-timeline-react';
export function PlayheadLayer() { return ( <> <Timeline.PlayheadArea className="absolute inset-0" /> <Timeline.PlayheadGrabber /> </> );}Notes
- Render these components inside a
TimelineProviderso they can read the sharedTimelineEngine. - Import
@techsquidtv/canvas-timeline-react/styles.csswhen your app defines shadcn-compatible semantic tokens, orbase.csswhen supplying your own theme. - CSS styles interaction layers; renderer theme styles canvas-painted timeline visuals.
- Use the theming guide when CSS tokens should drive canvas-painted colors.
API Reference
Playhead
Scrub and marker interactions for moving through timeline time.
Exports
| Name | Reference | Description |
|---|---|---|
Timeline.PlayheadArea | API reference | Transparent scrub area for moving the playhead and marker actions. |
Timeline.PlayheadGrabber | API reference | Draggable playhead handle with double-click marker behavior. |
Props and Inputs
| Name | Type | Description |
|---|---|---|
onDoubleClick | (time, engine, event) => void | Optional handler for double-click or double-tap marker behavior. |