Usage notes
Use this hook when UI needs selection state without the broader clip command surface from useTimelineClips. It is a good fit for inspectors, selection badges, grouped-clip panels, and toolbar enablement.
Signature
useTimelineSelection(): UseTimelineSelectionResultReturns
Selected clip and track state plus selection commands.
Examples
import { useTimelineSelection } from '@techsquidtv/canvas-timeline-react';
export function SelectionSummary() { const selection = useTimelineSelection();
if (!selection.hasSelection) { return <p>No selection</p>; }
return ( <p> {selection.selectedClipIds.length} clips selected {selection.selectedTrack ? ` on ${selection.selectedTrack.name}` : ''} </p> );}