Logoreact-timeline-editor

Props

Detailed property reference for the Timeline Editor component.

Property Reference

PropertyDescriptionTypeDefault
scrollTopScroll distance from the top of the editing area (@deprecated Please use ref.setScrollTop instead)number--
onScrollEditing area scroll callback (used to control synchronization with editing line scrolling)(params: OnScrollParams) => void--
autoScrollWhether to enable auto-scroll during draggingbooleanfalse
styleCustom timeline styleCSSProperties--
autoReRenderWhether to automatically re-render (update tick when data changes or cursor time changes)booleantrue
onChangeData change callback, triggered after data is changed at the end of operation (returning false prevents automatic engine synchronization, used to reduce performance overhead)(editorData: TimelineRow[]) => boolean | void--
editorDataTimeline editing dataTimelineRow[](Required)
effectsTimeline action effect mapRecord<string, TimelineEffect>(Required)
scaleSingle scale mark category (>0)number1
minScaleCountMinimum number of scales (>=1)number20
maxScaleCountMaximum number of scales (>=minScaleCount)numberInfinity
scaleSplitCountNumber of subdivisions per scale (>0 integer)number10
scaleWidthDisplay width of a single scale (>0, unit: px)number160
startLeftDistance from the left side of the scale start (>=0, unit: px)number20
rowHeightDefault height of each editing line (>0, unit: px)number32
gridSnapWhether to enable grid movement snapbooleanfalse
dragLineEnable drag auxiliary line snapbooleanfalse
hideCursorWhether to hide the cursorbooleanfalse
disableDragDisable all action area draggingbooleanfalse
enableRowDragEnable dragging to reorder entire track rowsbooleanfalse
enableCrossRowDragEnable dragging action blocks between different rowsbooleanfalse
enableGhostPreviewShow a ghost/preview element following the cursor during cross-row block dragbooleantrue
getGhostPreviewCustom ghost preview during cross-row drag({ action, row }) => ReactNode--
engineTimeline runner, uses built-in runner if not passedTimelineEngine--
getActionRenderCustom action area rendering(action: TimelineAction, row: TimelineRow) => ReactNode--
getScaleRenderCustom scale rendering(scale: number) => ReactNode--
onActionMoveStartStart moving callback(params: \{ action: TimelineAction; row: TimelineRow; \}) => void--
onActionMovingMoving callback (return false to prevent movement)(params: \{ action: TimelineAction; row: TimelineRow; start: number; end: number; \}) => boolean | void--
onActionMoveEndMove end callback (return false to prevent onChange from triggering)(params: \{ action: TimelineAction; row: TimelineRow; start: number; end: number; \}) => void--
onActionResizeStartStart resizing callback(params: \{ action: TimelineAction; row: TimelineRow; dir: "right" | "left"; \}) => void--
onActionResizingResize callback (return false to prevent change)(params: \{ action: TimelineAction; row: TimelineRow; start: number; end: number; dir: "right" | "left"; \}) => boolean | void--
onActionResizeEndResize end callback (return false to prevent onChange from triggering)(params: \{ action: TimelineAction; row: TimelineRow; start: number; end: number; dir: "right" | "left"; \}) => void--
onClickRowClick row callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ row: TimelineRow; time: number; \}) => void--
onClickActionClick action callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ action: TimelineAction; row: TimelineRow; time: number; \}) => void--
onClickActionOnlyClick action callback (not executed when drag is triggered)(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ action: TimelineAction; row: TimelineRow; time: number; \}) => void--
onDoubleClickRowDouble click row callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ row: TimelineRow; time: number; \}) => void--
onDoubleClickActionDouble click action callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ action: TimelineAction; row: TimelineRow; time: number; \}) => void--
onContextMenuRowRow right-click callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ row: TimelineRow; time: number; \}) => void--
onContextMenuActionAction right-click callback(e: MouseEvent<HTMLElement, MouseEvent>, param: \{ action: TimelineAction; row: TimelineRow; time: number; \}) => void--
getAssistDragLineActionIdsGet a list of action IDs for auxiliary lines(params: \{ action: TimelineAction; editorData: TimelineRow[]; row: TimelineRow; \}) => string[]--
onCursorDragStartCursor start drag event(time: number) => void--
onCursorDragEndCursor end drag event(time: number) => void--
onCursorDragCursor drag event(time: number) => void--
onClickTimeAreaClick time area event, return false to prevent setting time(time: number, e: MouseEvent<HTMLDivElement, MouseEvent>) => boolean--
onRowDragStartRow drag start callback(params: \{ row: TimelineRow \}) => void--
onRowDragEndRow drag end callback(params: \{ row: TimelineRow; editorData: TimelineRow[] \}) => void--
refComponent refRef<TimelineState>--
keyReact keyKey--

On this page