Track preview
A focused row layout showing track lanes and nested clip content.
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 VideoTrack() { return ( <div className="grid grid-cols-[12rem_minmax(0,1fr)]"> <Timeline.TrackHeaderList> <Timeline.TrackHeader trackId="video-1" /> </Timeline.TrackHeaderList> <Timeline.Track trackId="video-1" /> </div> );}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
Track
Timeline rows and optional DOM headers that size themselves from track state.
Exports
| Name | Reference | Description |
|---|---|---|
Timeline.Track | API reference | Track row element bound to a track id and synchronized row height. |
Timeline.TrackHeaderList | API reference | Static left-column container for DOM track headers. |
Timeline.TrackHeader | API reference | DOM track header row bound to one track id and synchronized row height. |
Timeline.TrackHeaderResizeHandle | API reference | Pointer-captured handle for resizing a track from its header row. |
Props and Inputs
| Name | Type | Description |
|---|---|---|
trackId | string | Id of the track row or header that should bind to timeline state. |