Overview
The renderer draws the dense parts of a timeline: clips, track lanes, ruler ticks, markers, snap lines, and feedback overlays. It keeps those visuals on canvas so zooming, scrolling, and playback do not create hundreds of DOM nodes.
Pair it with the React package for the default split: canvas for dense visuals, React and CSS for low-count interaction chrome.
Install
pnpm add @techsquidtv/canvas-timeline-renderernpm install @techsquidtv/canvas-timeline-rendereryarn add @techsquidtv/canvas-timeline-rendererbun add @techsquidtv/canvas-timeline-rendererUse the renderer when
- You want the default Canvas Timeline drawing pipeline.
- You need worker-backed rendering for dense clip and ruler surfaces.
- You want renderer theme helpers that resolve CSS and shadcn-style tokens into canvas colors.
Usage
Render dense timeline visuals on canvas
Place CanvasRenderer inside Timeline.Root while a TimelineProvider is active. Let the renderer own repeated visual drawing and keep product controls, inspectors, and interaction affordances in React.
- 1Create a
TimelineEnginewith tracks, clips, markers, and viewport state. - 2Render
CanvasRendererinside the timeline root. - 3Import package styles from the React or main package so DOM chrome has structural CSS.
- 4Customize renderer theme options only when app-level tokens are not enough.
Example
import type { TimelineEngine } from '@techsquidtv/canvas-timeline-core';import { Timeline, TimelineProvider } from '@techsquidtv/canvas-timeline-react';import { CanvasRenderer } from '@techsquidtv/canvas-timeline-renderer';
export function TimelineCanvas({ engine }: { engine: TimelineEngine }) { return ( <TimelineProvider engine={engine}> <Timeline.Root> <CanvasRenderer /> <Timeline.PlayheadGrabber /> <Timeline.ClipInteractionLayer /> </Timeline.Root> </TimelineProvider> );}