@techsquidtv/canvas-timeline-react
packages/react/src/index.ts
Common Entry Points
Start with these essential APIs, then check the full reference index below.
TimelineProvider
Sets up a bridge between the central event-driven `TimelineEngine` model and standard React functional layouts. Subscribes to settled state, selection, playback, content, and clipboard changes, pushing lightweight state updates downwards into hooks.
VariableTimeline
Namespace of timeline UI components for composing an editor surface.
Timeline HooksuseTimeline
Reads the timeline engine and synchronized state from React context. Use this hook inside components wrapped by `TimelineProvider` when you need to call imperative engine commands and read the latest React-rendered state in the same component. Prefer narrower hooks such as `useTimelineState`, `useTimelinePlayback`, or `useTimelineClips` when a component only needs one slice of timeline behavior.
Timeline HooksuseTimelineState
Reads the current synchronized timeline state. This is a render-focused shortcut for components that need track, playhead, zoom, scroll, marker, or playback state without calling engine methods. The returned value updates when `TimelineProvider` receives engine state events.
Timeline HooksuseTimelinePlayback
Provides canonical transport, playhead command, and in/out range commands. Compose this with `useTimelinePlayheadTime` when a component also needs a live clock readout.
VariableTimecodeField
Compact timecode field parts. `TimecodeField.Root` owns editing state. `TimecodeField.Trigger` renders the compact displayed value, and `TimecodeField.Input` renders the temporary `TimecodeInput` used for typed edits.
API Index
Exhaustive list of all public exports grouped by category.
Timeline Hooks
52Returns clips that intersect the current playhead time. A clip is active when the playhead is at or after `timelineStart` and before `timelineEnd`. Clips on hidden tracks, muted tracks, and clips marked `disabled` are omitted. The returned array contains clips only; read the timeline state when you also need the containing track id.
useActiveLayersReturns active timeline layers at a timeline time. The hook is collection-first: each named layer returns every matching active clip in stable track order. `primary` is only a convenience first match.
useActiveMarkersSubscribes to live marker proximity derived from the current playhead. Use this focused live hook for readouts and marker navigation UI that should update during playback or scrubbing. Use `useTimelineMarkers` for ordinary marker lists and marker editing commands.
useClipEditPreviewReads the transient edit-preview state for a clip. Use this for custom clip UIs that need to render live editing affordances, such as overwrite cut indicators, without depending on internal engine flags.
usePlaybackEffectSubscribes to real-time playback events (enter, update, leave) for a specific clip as the global playhead crosses the clip's boundary timestamps.
useTimelineReads the timeline engine and synchronized state from React context. Use this hook inside components wrapped by `TimelineProvider` when you need to call imperative engine commands and read the latest React-rendered state in the same component. Prefer narrower hooks such as `useTimelineState`, `useTimelinePlayback`, or `useTimelineClips` when a component only needs one slice of timeline behavior.
useTimelineClipboardProvides access to clipboard operations for copying, cutting, and pasting clips.
useTimelineClipDragHeadless clip body drag behavior shared by canvas and custom timeline UIs.
useTimelineClipDropFeedbackSubscribes to live cross-track clip drop feedback. This is a focused live interaction hook intended for custom drag affordances.
useTimelineClipNavigationProvides constant-DOM keyboard navigation and commands for canvas clips. The hook flattens canvas-rendered clips into a navigable model without mounting one DOM element per clip. Consumers can use the returned `focusTargetProps` on a single focused element, or wire the navigation and edit commands into their own shortcut system and selected-clip inspector.
useTimelineClipRectsReturns viewport-space geometry for every timeline clip. The hook subscribes to geometry-affecting timeline events and intentionally does not subscribe to playhead-only updates.
useTimelineClipsProvides the canonical clip collection and editing actions for React editor UI.
useTimelineEditCommandsExposes command-layer edit APIs for React product chrome. The hook is a thin adapter over `TimelineEngine` command methods; it does not implement edit math or range mutation rules in React.
useTimelineEditImpactsSubscribes to live edit impacts produced by active timeline interactions. This is a live interaction hook: it can update during drag and trim gestures. Use it for custom headless UI affordances that show which clips are trimmed, split, or removed by the active edit.
useTimelineEditModeOwns local edit-mode state for product toolbar chrome. The selected mode does not mutate engine state by itself. Compose it with `useTimelineEditCommands` to build and preview typed edit commands.
useTimelineEditPreviewSubscribes to live command-layer edit previews. This is a focused live hook. It updates when command previews change and does not broaden provider state with drag-time edit consequences.
useTimelineEventSubscribes to a typed TimelineEngine event with a React-safe latest handler. The hook keeps the event subscription stable while updating the callback ref every render, avoiding stale closures without resubscribing for handler-only changes.
useTimelineHistoryProvides canonical undo/redo history access for timeline editor chrome.
useTimelineInOutRangeControlAdapts timeline In/Out points to a Base UI-compatible range slider. The hook keeps loop or export boundaries in sync with `TimelineEngine` `inPoint` and `outPoint` values while returning semantic labels and `aria-valuetext` strings for each thumb. `Timeline.RangeSelector.Root` uses this hook internally; consumers can call it directly when composing their own Base UI slider surface.
useTimelineKeyboardProvides focus-scoped timeline keyboard shortcuts. The hook never installs global listeners. It handles shortcuts only from the element that spreads `scopeProps` or one of that element's descendants.
useTimelineKeyframeCurveDragHeadless Bezier curve handle drag behavior shared by package and custom timeline UIs.
useTimelineKeyframeCurvesReads timeline keyframe curve geometry and exposes Bezier easing commands.
useTimelineKeyframeDragHeadless keyframe drag behavior shared by canvas and custom timeline UIs.
useTimelineKeyframesReads timeline keyframe geometry and exposes canonical keyframe commands.
useTimelineMarkersAccesses and manages bookmark/annotation pins (markers). This canonical marker hook does not subscribe to live playhead ticks. Compose it with `useActiveMarkers` when UI needs marker proximity at the current playhead.
useTimelineMediaPlaybackCoordinates timeline playback with an external media clock. The hook is media-library agnostic. Apps provide a clock and a single layer sync callback while the hook advances the TimelineEngine playhead and decides when active layer clips need to be resynchronized.
useTimelineMediaSyncHigh-level synchronization for external media surfaces. The hook remains media-library agnostic: apps provide an adapter for decoding, rendering, and audio scheduling, while the hook handles active layer lookup, first-content seeking, external-clock playback, rate changes, and pause state.
useTimelinePanControlAdapts horizontal timeline scroll to a Base UI-compatible scalar slider. Use this hook when an application wants a semantic pan control for `TimelineEngine.scrollLeft`. It overlaps with `useTimelineViewport` only at the engine command layer; this hook adds slider props, bounds, and formatted ARIA value text for custom UI primitives.
useTimelinePlaybackProvides canonical transport, playhead command, and in/out range commands. Compose this with `useTimelinePlayheadTime` when a component also needs a live clock readout.
useTimelinePlayheadControlAdapts the timeline playhead to a Base UI-compatible scalar slider. Use this hook when an application wants its own playhead scrubber, time field, or transport control while preserving the shared `TimelineEngine` state. It composes with `useTimelinePlayback`, which exposes imperative transport commands without subscribing to live playhead ticks.
useTimelinePlayheadTimeHook to subscribe directly to playhead scrubbing changes. Bypasses root-level context state updates to keep scrubbing high-performance.
useTimelineRangeSelectionAdapts timeline In/Out points to command-layer range selection. The hook treats a complete In/Out pair as the selected edit range and delegates range mutations to `useTimelineEditCommands`.
useTimelineRulerTicksReturns shared viewport-space ruler ticks for DOM and custom timeline chrome. The hook subscribes to geometry-affecting timeline events and intentionally does not subscribe to playhead-only updates.
useTimelineScrollLeftHook to subscribe directly to scroll left position changes. Bypasses root-level context state updates for smooth scroll navigation.
useTimelineScrollTopHook to subscribe directly to scroll top position changes. Bypasses root-level context state updates for smooth vertical navigation.
useTimelineSelectionProvides the canonical selected clip/track model for timeline editor chrome.
useTimelineSnappingProvides the canonical snapping state and commands for editor UI.
useTimelineStateReads the current synchronized timeline state. This is a render-focused shortcut for components that need track, playhead, zoom, scroll, marker, or playback state without calling engine methods. The returned value updates when `TimelineProvider` receives engine state events.
useTimelineTimePositionImperatively positions a low-count DOM affordance at a timeline time. The returned transform is viewport-space: `seconds * zoomScale - scrollLeft`. Use it for standalone affordances such as the playhead grabber. Range controls that already live inside a transformed timeline overlay should use their local control primitive positioning instead.
useTimelineTrackAccesses one timeline track with canvas-aligned row geometry and commands.
useTimelineTrackDropTargetsBuilds headless track drop targets for cross-track clip movement.
useTimelineTrackHeaderAdapts one timeline track into DOM-ready track header state.
useTimelineTrackLockControlAdapts one timeline track into a semantic lock toggle button.
useTimelineTracksAccesses and manages the list of timeline tracks.
useTimelineVerticalRangeControlAdds formatted accessibility values to the vertical timeline scrollbar adapter.
useTimelineVerticalScrollbarAdapts generic range scrollbar state to the timeline's vertical track viewport. The hook derives a controlled `{ start, end }` value from `scrollTop`, `viewportHeight`, and track-stack bounds. Thumb changes pan the engine-owned vertical scroll position so canvas rows and external DOM chrome can stay in sync. Handle changes scale expanded track heights, giving the range handles a vertical zoom behavior that matches the horizontal viewport scrollbar's shape.
useTimelineViewportProvides canonical viewport metrics and setters for custom timeline chrome.
useTimelineViewportRangeControlAdds formatted accessibility values to the timeline viewport range adapter. This hook builds on `useTimelineViewportScrollbar`, preserving the same lean viewport scrollbar geometry and keyboard behavior while adding `aria-valuetext` formatting for the thumb and resize handles. Use it with the generic `RangeScrollbar` primitive when composing a custom viewport control.
useTimelineViewportScrollbarAdapts generic range scrollbar state to the current timeline viewport. The hook derives a controlled `{ start, end }` value from timeline `scrollLeft`, `zoomScale`, `viewportWidth`, and content duration. Thumb changes pan the engine, while handle changes update zoom and then restore the requested range start.
useTimelineVisibleClipsReturns viewport-intersecting timeline clips with clipped time/source ranges. This is the preferred hook for custom DOM clip renderers and custom canvas layers that only need visible or near-visible clips.
useTimelineZoomControlAdapts timeline zoom scale to a Base UI-compatible scalar slider. Use this hook when a product toolbar needs a focused, semantic zoom control rather than broad viewport commands from `useTimelineViewport`. The returned root props mutate `TimelineEngine.zoomScale`; thumb props provide the default label and formatted `aria-valuetext`.
useTimelineZoomScaleHook to subscribe directly to zoom changes. Bypasses root-level context state updates for low-latency zoom interaction.
Primitive Hooks
1Interface
107Details passed to a clip double-click or double-tap callback.
ClipInteractionLayerPropsProps for the delegated clip interaction layer.
KeyboardScopePropsProps for the focus-scoped timeline keyboard shortcut wrapper.
KeyframeCurveHandleDoubleClickDetailsDetails passed to a Bezier curve handle double-click or double-tap callback.
KeyframeCurveInteractionLayerPropsProps for the delegated Bezier curve interaction layer.
KeyframeDeleteDetailsDetails passed to a keyframe keyboard delete callback.
KeyframeDoubleClickDetailsDetails passed to a keyframe double-click or double-tap callback.
KeyframeInteractionLayerPropsProps for the delegated keyframe interaction layer.
PlayheadAreaPropsProps for the interactive playhead scrub area.
PlayheadGrabberPropsProps for the draggable playhead handle.
RangeChangeDetailsChange metadata emitted by Base UI range slider interactions.
RangeScrollbarAriaValueTextDetailsContext passed to a range scrollbar `aria-valuetext` formatter.
RangeScrollbarHandlePropsProps for a range scrollbar resize handle.
RangeScrollbarRootPropsProps for the controlled range scrollbar root.
RangeScrollbarThumbPropsProps for the draggable range scrollbar thumb.
RangeScrollbarValueControlled numeric range represented by a range scrollbar. `start` and `end` use the caller's domain units. For a timeline adapter those units might be seconds; for a chart they might be indexes, prices, or pixels.
RangeScrollbarValueChangeDetailsDetails passed with a controlled range scrollbar value change.
RangeSelectorGrabberRenderPropsRender-prop payload for custom range selector grabber children.
RangeSelectorPropsProps for the high-level timeline range selector overlay.
RangeSelectorRootPropsProps for the RangeSelector Root component.
TimecodeFieldCommitDetailsDetails passed when a `TimecodeField` commits a valid value.
TimecodeFieldInputPropsProps for the temporary typed timecode editor.
TimecodeFieldRootPropsProps for the compact inline timecode editing root.
TimecodeFieldTriggerPropsProps for the compact displayed timecode value.
TimecodeInputPropsProps for the timecode text input primitive. Extends Base UI `Input` props, so controlled and uncontrolled React input patterns both work. Use `onValueChange` for the current text value as the user types, or `onChange` when composing with native form handlers. By default it renders as a plain text input, disables browser autocomplete, and disables spellcheck so punctuation-heavy values such as `1:02:03.04` stay visually stable. Pass explicit native input props when a form needs different behavior.
TimeGrabberRenderPropsRender-prop payload for custom draggable time grabber children.
TimelineClipDragMoveInputPointer data needed to update a clip body drag.
TimelineClipDragStartInputPointer data needed to begin a clip body drag.
TimelineClipEntryFlattened clip metadata shared by core geometry APIs, React hooks, and custom renderers.
TimelineClipNavigationOptionsOptions for constant-DOM canvas clip navigation.
TimelineCommandResultConsistent result returned by React hook command APIs.
TimelineContextValueInterface representing the context bundle of the timeline provider.
TimelineEventOptionsOptions for `useTimelineEvent`.
TimelineInOutRangeControlOptionsOptions for adapting timeline In/Out points to a range control.
TimelineKeyBindingSingle keyboard chord mapped to a timeline command.
TimelineKeyboardBindingOptionsOptions for creating preset timeline keyboard bindings.
TimelineKeyboardEventLikeKeyboard-event fields used by the pure shortcut matcher.
TimelineKeyboardOptionsOptions for `useTimelineKeyboard`.
TimelineKeyframeCurveDragMoveInputPointer data needed to update a Bezier curve handle drag.
TimelineKeyframeCurveDragStartInputPointer data needed to begin a Bezier curve handle drag.
TimelineKeyframeCurveDragUpdateSuccessful Bezier curve handle drag update payload.
TimelineKeyframeCurveEasingUpdateInputInput for updating one keyframe's Bezier easing.
TimelineKeyframeDragMoveInputPointer data needed to update a keyframe drag.
TimelineKeyframeDragStartInputPointer data needed to begin a keyframe drag.
TimelineKeyframeDragUpdateSuccessful keyframe drag update payload.
TimelineLayerSyncDetailsDetails passed to external media sync callbacks.
TimelineMediaSyncAdapterAdapter callbacks used to connect timeline playback to an external media clock.
TimelineNavigableClipMetadata for one canvas-rendered clip exposed through clip navigation.
TimelinePanControlOptionsOptions for adapting horizontal timeline scroll to a scalar control.
TimelinePlayheadControlOptionsOptions for adapting the timeline playhead to a scalar control.
TimelineProviderPropsProps for wiring a TimelineEngine into React context.
TimelineRangeSelectionTimeline range selected for range edit commands.
TimelineRangeValueFormatOptionsOptions for formatting a timeline start/end range for assistive technology.
TimelineSelectionStateSelected clip and track state derived from the current timeline snapshot.
TimelineTimeValueFormatOptionsOptions for formatting a single timeline time value for assistive technology.
TimelineTrackDropContextContext passed to custom clip track-drop guards.
TimelineTrackDropResultResult of resolving whether a clip may drop on a track.
TimelineViewportRangeControlOptionsOptions for viewport scrollbar accessibility formatting.
TimelineZoomControlOptionsOptions for adapting timeline zoom to a scalar control.
TrackHeaderListPropsProps for the track header list column.
TrackHeaderPropsProps for one timeline track header row.
TrackHeaderResizeHandlePropsProps for the track header resize handle.
TrackItemPropsProps for a timeline track row bound to a track id.
UseActiveMarkersResultResult returned by `useActiveMarkers`.
UseRangeScrollbarOptionsOptions for deriving generic range scrollbar state and update helpers.
UseRangeScrollbarResultGeneric range scrollbar geometry and mutation helpers.
UseTimelineClipboardResultResult returned by `useTimelineClipboard`.
UseTimelineClipDragOptionsOptions accepted by `useTimelineClipDrag`.
UseTimelineClipDragResultResult returned by `useTimelineClipDrag`.
UseTimelineClipDropFeedbackResultResult returned by `useTimelineClipDropFeedback`.
UseTimelineClipsResultResult returned by `useTimelineClips`.
UseTimelineEditCommandsResultResult returned by `useTimelineEditCommands`.
UseTimelineEditImpactsResultResult returned by `useTimelineEditImpacts`.
UseTimelineEditModeResultResult returned by `useTimelineEditMode`.
UseTimelineEditPreviewResultResult returned by `useTimelineEditPreview`.
UseTimelineHistoryResultResult returned by `useTimelineHistory`.
UseTimelineKeyboardResultResult returned by `useTimelineKeyboard`.
UseTimelineKeyframeCurveDragResultResult returned by `useTimelineKeyframeCurveDrag`.
UseTimelineKeyframeCurvesOptionsOptions accepted by `useTimelineKeyframeCurves`.
UseTimelineKeyframeCurvesResultResult returned by `useTimelineKeyframeCurves`.
UseTimelineKeyframeDragOptionsOptions accepted by `useTimelineKeyframeDrag`.
UseTimelineKeyframeDragResultResult returned by `useTimelineKeyframeDrag`.
UseTimelineKeyframesOptionsOptions accepted by `useTimelineKeyframes`.
UseTimelineKeyframesResultResult returned by `useTimelineKeyframes`.
UseTimelineMarkersResultResult returned by `useTimelineMarkers`.
UseTimelineMediaPlaybackOptionsOptions for coordinating timeline playback with an external media clock.
UseTimelineMediaPlaybackResultResult returned by `useTimelineMediaPlayback`.
UseTimelineMediaSyncOptionsOptions for high-level timeline media synchronization.
UseTimelineMediaSyncResultResult returned by `useTimelineMediaSync`.
UseTimelinePlaybackResultResult returned by `useTimelinePlayback`.
UseTimelineRangeSelectionResultResult returned by `useTimelineRangeSelection`.
UseTimelineSelectionResultResult returned by `useTimelineSelection`.
UseTimelineSnappingResultResult returned by `useTimelineSnapping`.
UseTimelineTimePositionOptionsOptions for `useTimelineTimePosition`.
UseTimelineTimePositionResultResult returned by `useTimelineTimePosition`.
UseTimelineTrackDropTargetsOptionsOptions accepted by `useTimelineTrackDropTargets`.
UseTimelineTrackDropTargetsResultResult returned by `useTimelineTrackDropTargets`.
UseTimelineTrackHeaderResultResult returned by `useTimelineTrackHeader`.
UseTimelineTrackLockControlResultResult returned by `useTimelineTrackLockControl`.
UseTimelineTrackResultResult returned by `useTimelineTrack`.
UseTimelineTracksResultResult returned by `useTimelineTracks`.
UseTimelineVerticalRangeControlResultState and formatted accessibility props for a vertical timeline scrollbar.
UseTimelineVerticalScrollbarResultState and control props for rendering a vertical timeline scrollbar.
UseTimelineViewportResultResult returned by `useTimelineViewport`.
UseTimelineViewportScrollbarOptionsOptions for adapting a generic range scrollbar to the timeline viewport.
UseTimelineViewportScrollbarResultState and control props for rendering a timeline viewport scrollbar.
ViewportScrollbarRootPropsProps for the timeline viewport scrollbar root.
Type Alias
40Timeline range boundary controlled by an In/Out grabber.
RangeScrollbarChangeReasonReason a range scrollbar requested a controlled value change.
RangeScrollbarHandleSideSide of the range scrollbar thumb controlled by a resize handle.
RangeScrollbarOrientationVisual and interaction axis used by a range scrollbar.
RangeSelectorGrabberChildrenCustom node or render prop used inside an In/Out range selector grabber.
TimecodeFieldCommitReasonReason a `TimecodeField` committed the current draft text.
TimecodeFrameRateFrame rate accepted by frame-based `TimecodeInput` helpers. Use numbers for simple rates such as `24`, `25`, `30`, or `60`. Use rational objects for exact fractional media rates such as `{ numerator: 30000, denominator: 1001 }`.
TimecodeInputFormatDisplay shape used when formatting seconds for a `TimecodeInput`. `auto` keeps common decimal clock text unless a frame rate is provided. With a frame rate, `auto` formats frame timecode. `seconds`, `minutes`, and `hours` keep decimal centiseconds. `frames` formats `HH:MM:SS:FF`, and `drop-frame` formats `HH:MM:SS;FF`.
TimecodeInputFormatOptionsOptions for formatting a seconds value into editable `TimecodeInput` text.
TimecodeInputParseOptionsOptions for parsing editable `TimecodeInput` text into seconds.
TimecodeInputParseRoundingRounding policy used when parsing editable `TimecodeInput` text. `none` preserves the decimal precision entered by the user, within normal JavaScript number limits. `centisecond` rounds parsed seconds to two decimal places for legacy or display-like workflows.
TimeGrabberChildrenCustom node or render prop used inside a draggable time grabber.
TimelineClipUpdateEditable presentation fields accepted by `useTimelineClips().updateClip`.
TimelineCommandFailureReasonMachine-readable reason a timeline command could not be applied.
TimelineContentPlaybackStatusStatus emitted by the timeline media playback hook.
TimelineEventHandlerCallback signature for a typed TimelineEngine event subscription.
TimelineKeyboardBindingsCommand-to-bindings map accepted by `useTimelineKeyboard`.
TimelineKeyboardCommandTimeline command names supported by the keyboard scope.
TimelineKeyboardPlatformPlatform bucket used for platform-specific professional editor bindings.
TimelineKeyboardPresetNamed shortcut presets for `useTimelineKeyboard`.
TimelineMarkerUpdateEditable marker fields accepted by `useTimelineMarkers().updateMarker`.
TimelineMediaPlayFailureReasonReason high-level media-synchronized playback could not begin.
TimelineMediaPlayResultResult returned from a media-synchronized timeline play request. This high-level media adapter result is intentionally richer than `TimelineCommandResult` because failures include user-facing adapter messages in addition to machine-readable reasons.
TimelineMediaSyncReasonReason an external media callback is being synchronized.
TimelineTimePositionEventEngine events that should refresh an imperatively positioned timeline element.
TimelineTrackDropGuardCustom policy for accepting or rejecting track drop targets.
TimelineTrackHeaderRootPropsDOM props returned for a track header row.
TimelineTrackLockControlButtonPropsProps returned for a track lock button.
TimelineVerticalScrollbarRangePropsControlled props required by `RangeScrollbar.Root` for vertical timeline scrolling.
TimelineViewportScrollbarRangePropsControlled props required by `RangeScrollbar.Root` for a timeline viewport.
TrackHeaderChildrenRender prop accepted by `Timeline.TrackHeader`.
UseTimelineClipRectsOptionsOptions accepted by `useTimelineClipRects`.
UseTimelineKeyframeCurveDragOptionsOptions accepted by `useTimelineKeyframeCurveDrag`.
UseTimelineRulerTicksOptionsOptions accepted by `useTimelineRulerTicks`.
UseTimelineVisibleClipsOptionsOptions accepted by `useTimelineVisibleClips`.
VerticalScrollbarHandlePropsProps for a timeline vertical scrollbar resize handle.
VerticalScrollbarRootPropsProps for the timeline vertical scrollbar root.
VerticalScrollbarThumbPropsProps for the timeline vertical scrollbar thumb.
ViewportScrollbarHandlePropsProps for a timeline viewport scrollbar resize handle.
ViewportScrollbarThumbPropsProps for the timeline viewport scrollbar thumb.
Variable
10Minimal keyboard preset: playback only.
professionalEditorTimelineKeyboardBindingsProfessional editor preset bindings that do not depend on frame rate or platform.
RangeScrollbarNamespace of generic controlled range scrollbar primitives.
RangeScrollbarHandleResize handle for moving one side of the visible range.
RangeScrollbarRootRoot element for a controlled generic range scrollbar.
RangeScrollbarThumbDraggable thumb representing the visible range within a larger domain.
TimecodeFieldCompact timecode field parts. `TimecodeField.Root` owns editing state. `TimecodeField.Trigger` renders the compact displayed value, and `TimecodeField.Input` renders the temporary `TimecodeInput` used for typed edits.
TimecodeInputText input for entering timeline positions as timecode. Use `TimecodeInput` when a toolbar, inspector, or properties panel needs a native text input for clip starts, clip ends, playhead positions, or range boundaries. It keeps flexible entry open to the user (`90`, `1:30.25`, `1:02:03.4567`, and `00:01:30:12` can all represent timeline positions) while the companion helpers parse precise input and format display text consistently. This component renders only the input. Pair it with `parseTimecodeInput` to validate the current text, pass `invalid` when parsing returns `null`, and convert valid seconds back to `RationalTime` with `fromSeconds(parsed, rate)` at your timeline boundary. The rendered input receives `data-slot="timecode-input"` and a `timecode-input` class before consumer classes, which keeps it compatible with shadcn-style slot selectors and Canvas Timeline's semantic stylesheet approach. It forwards refs to the underlying native input element.
TimelineNamespace of timeline UI components for composing an editor surface.
TimelineContextReact context containing the global engine controller and its reactive state model.
Function
13Creates the built-in keyboard binding map for a preset.
deriveTimelineSelectionDerives selected clip and track metadata from timeline tracks.
flattenTimelineClipsFlattens timeline tracks into stable clip entries.
formatTimecodeInputFormats seconds for editable `TimecodeInput` text. Decimal formats are rounded to centiseconds and clamped at zero. Frame formats round to the nearest frame for the supplied frame rate. Use this at UI boundaries after converting from `RationalTime` with `toSeconds`.
formatTimelineRangeValueFormats a start/end timeline range for assistive technology.
formatTimelineTimeValueFormats a timeline time for assistive technology. The result intentionally avoids timecode punctuation and raw floating point artifacts so controls can use it as `aria-valuetext`.
getClipAccessibleDescriptionReturns a richer clip description without requiring one DOM node per clip.
getClipAccessibleNameReturns a concise clip name suitable for labels or active-item summaries.
getTimelineKeyboardCommandResolves a keyboard event to the first matching command in stable command order.
parseTimecodeInputParses editable `TimecodeInput` text into seconds. Accepts plain seconds, decimal seconds, `m:ss`, `m:ss.cc`, `h:mm:ss`, `h:mm:ss.cc`, flexible single-digit colon segments such as `1:2`, and unit suffixes like `s` (seconds), `ms` (milliseconds), `m` (minutes), or `f` (frames, which requires a `frameRate` option). Invalid, negative, missing, or out-of-range user text returns `null`. Invalid developer options such as unsupported drop-frame rates throw `RangeError`.
timelineCommandFailCreates a failed timeline command result.
timelineCommandOkCreates a successful timeline command result.
TimelineProviderSets up a bridge between the central event-driven `TimelineEngine` model and standard React functional layouts. Subscribes to settled state, selection, playback, content, and clipboard changes, pushing lightweight state updates downwards into hooks.