Function

useTimelineTrackHeader

Adapts one timeline track into DOM-ready track header state.

Usage notes

Use this hook for custom track header columns that should remain aligned with canvas row geometry. It reads row state from useTimelineTrack, derives a stable label, and returns root props with data attributes for styling selected, muted, locked, visible, targeted, and collapsed states.

Signature

Type Definition
useTimelineTrackHeader(trackId: string, options: TimelineTrackGeometryOptions = {}): UseTimelineTrackHeaderResult<TrackKind>

Type parameters

NameConstraintDefaultDescription
TrackKindstringstringApp-defined track kind value carried by the requested track.

Parameters

NameTypeDescription
trackIdstringTrack id to bind.
optionsTimelineTrackGeometryOptionsOptional track geometry overrides matching the renderer.

Returns

Track row state plus header label and root DOM props.

Examples

tsx Example
import { useTimelineTrackHeader } from '#react/hooks';
export function CustomTrackHeader({ trackId }: { trackId: string }) {
const header = useTimelineTrackHeader(trackId);
return (
<div {...header.rootProps}>
<span>{header.label}</span>
<button type="button" aria-pressed={header.locked} onClick={() => header.toggleLock()}>
Lock
</button>
</div>
);
}