Signature
useTimelineClipNavigation(options: TimelineClipNavigationOptions<TrackKind> = {}): objectType parameters
| Name | Constraint | Default | Description |
|---|---|---|---|
TrackKind | None | string | No type parameter summary yet. |
Parameters
| Name | Type | Description |
|---|---|---|
| options | TimelineClipNavigationOptions<TrackKind> | Initial active clip and navigation behavior options. |
Returns
object
Active clip metadata, flattened clip list, navigation commands, edit commands, and optional focus-target props.
Return members
| Name | Signature | Description |
|---|---|---|
activeClip | activeClip: TimelineNavigableClip<TrackKind> | null | Metadata for the active navigable clip, or `null` when no clips exist. |
activeClipId | activeClipId: string | Clip id for the active navigable clip. |
activeClipStatusText | activeClipStatusText: string | Active clip summary suitable for an accessible label or live status. |
clipCount | clipCount: number | Number of navigable clips. |
clips | clips: TimelineNavigableClip<TrackKind>[] | Flattened list of canvas clips with accessibility metadata. |
focusTargetProps | focusTargetProps: HTMLAttributes<HTMLElement> | Default props for a single focusable clip-navigation target. |
getFocusTargetProps | (props: HTMLAttributes<T> = {}): HTMLAttributes<T> | Builds props for a single focusable clip-navigation target. |
isFocusTargetFocused | isFocusTargetFocused: boolean | Whether the returned focus target currently contains focus. |
moveActiveClipBy | (deltaSeconds: number): TimelineCommandResult<void> | TimelineCommandResult<TimelineClipMoveResult> | Moves the active clip by a relative number of seconds and returns the command result. |
moveActiveClipToTrack | (deltaTrackIndex: number): TimelineCommandResult<void> | TimelineCommandResult<TimelineClipMoveResult> | Moves the active clip vertically by a relative track delta and returns the command result. |
navigateBy | (delta: number): TimelineNavigableClip<TrackKind> | null | Moves active navigation by a flattened clip delta. |
navigateToFirst | (): TimelineNavigableClip<TrackKind> | Moves active navigation to the first clip in timeline order. |
navigateToLast | (): TimelineNavigableClip<TrackKind> | Moves active navigation to the last clip in timeline order. |
navigateToTrack | (delta: number): TimelineNavigableClip<TrackKind> | null | Moves active navigation vertically between tracks. |
selectActiveClip | (): void | Selects the active clip in the timeline engine. |
setActiveClip | (clipId: string | null): void | Sets the active clip id and optionally selects it in the engine. |
trimActiveClipBy | (edge: "start" | "end", deltaSeconds: number): TimelineCommandResult<void> | Trims one edge of the active clip by a relative number of seconds and returns the command result. |
Examples
const clipNavigation = useTimelineClipNavigation();
return ( <div {...clipNavigation.focusTargetProps}> {clipNavigation.activeClip?.name} </div>);