Overview
The main package is the easiest way to start a Canvas Timeline editor. It re-exports the core engine, React bindings, renderer, and time utilities from one dependency so early app code can stay focused on the editor experience.
As your project grows, you can keep using this package or switch individual imports to the focused packages below. The runtime pieces are the same; the split package paths are there when you want sharper ownership boundaries.
Install
pnpm add @techsquidtv/canvas-timelinenpm install @techsquidtv/canvas-timelineyarn add @techsquidtv/canvas-timelinebun add @techsquidtv/canvas-timelineStart here when
- You are building a React timeline editor and want the common engine, UI bindings, renderer, and utilities together.
- You want one install path while you are still proving out the editor shape.
- You expect to use the default React interaction chrome and canvas renderer.
Usage
Start with the assembled editor surface
Create a TimelineEngine, provide it with TimelineProvider, render the canvas with CanvasRenderer, and layer the React interaction components above it. Import styles.css when you want the packaged structural CSS plus the default token-driven chrome.
- 1Create the engine with your initial tracks, clips, markers, and duration.
- 2Wrap the editor UI in
TimelineProvider. - 3Render
Timeline.Root,CanvasRenderer, and the timeline interaction components your product needs. - 4Import
@techsquidtv/canvas-timeline/styles.cssonce in the app entry or demo source.
Example
import { CanvasRenderer, Timeline, TimelineEngine, TimelineProvider, fromSeconds,} from '@techsquidtv/canvas-timeline';import '@techsquidtv/canvas-timeline/styles.css';
const engine = new TimelineEngine({ duration: fromSeconds(30), tracks: [],});
export function Editor() { return ( <TimelineProvider engine={engine}> <Timeline.Root> <CanvasRenderer /> <Timeline.PlayheadArea /> <Timeline.PlayheadGrabber /> <Timeline.ClipInteractionLayer /> </Timeline.Root> </TimelineProvider> );}