Usage notes
`useTimelineKeyframes` is the main keyframe-domain hook. It reads settled keyframe state. Use useTimelineKeyframeGeometry for live overlays. Mutation commands return
TimelineCommandResult values and respect locked tracks.
Signature
useTimelineKeyframes(options: UseTimelineKeyframesOptions = {}): UseTimelineKeyframesResultParameters
| Name | Type | Description |
|---|---|---|
| options | UseTimelineKeyframesOptions | Optional clip, property, and selected-clip filters. |
Returns
Settled keyframe lists, selection, property evaluation, and mutation commands.
Examples
import { fromSeconds } from '@techsquidtv/canvas-timeline-utils';import { useTimelineKeyframes } from '@techsquidtv/canvas-timeline-react';
export function OpacityKeyframeButton({ clipId }: { clipId: string }) { const keyframes = useTimelineKeyframes({ clipId, property: 'opacity' });
return ( <button type="button" onClick={() => keyframes.setKeyframe({ clipId, property: 'opacity', time: fromSeconds(1), value: 0.5, }) } > Add opacity keyframe </button> );}