Logoreact-timeline-editor
API Reference

Timeline Props Reference

Complete API reference for all props accepted by the <Timeline /> component.

Complete API reference for all props accepted by the <Timeline /> component from @keplar-404/react-timeline-editor.

Required Props

PropertyTypeDescription
editorDataTimelineRow[](Required) Timeline editing data
effectsRecord<string, TimelineEffect>(Required) Timeline action effect map

Scroll & Layout

PropertyTypeDefaultDescription
scrollTopnumber--@deprecated — use ref.setScrollTop instead
onScroll(params: OnScrollParams) => void--Scroll callback
autoScrollbooleanfalseEnable auto-scroll during dragging
styleCSSProperties--Custom timeline inline style

Scale & Display

PropertyTypeDefaultDescription
scalenumber1Single scale mark duration in seconds (>0)
minScaleCountnumber20Minimum number of scale marks (>=1)
maxScaleCountnumberInfinityMaximum number of scale marks
scaleSplitCountnumber10Subdivisions per scale mark (>0 integer)
scaleWidthnumber160Display width of a single scale mark (px, >0)
startLeftnumber20Left inset before scale start (px, >=0)
rowHeightnumber32Default row height (px, >0)

Behavior & Interaction

PropertyTypeDefaultDescription
autoReRenderbooleantrueAuto re-render on data/cursor time change
gridSnapbooleanfalseEnable grid movement snapping
dragLinebooleanfalseEnable drag auxiliary line snapping
hideCursorbooleanfalseHide the playback cursor
disableDragbooleanfalseDisable all action dragging

Engine

PropertyTypeDefaultDescription
engineTimelineEnginebuilt-inCustom timeline engine instance

Data Change

PropertyTypeDefaultDescription
onChange(editorData: TimelineRow[]) => boolean | void--Data change callback. Return false to skip engine sync

Custom Renderers

PropertyTypeDescription
getActionRender(action: TimelineAction, row: TimelineRow) => ReactNodeCustom render for action blocks
getScaleRender(scale: number) => ReactNodeCustom render for scale marks

Fork-Exclusive Props

PropertyTypeDefaultDescription
enableRowDragbooleanfalseEnable drag-to-reorder entire rows
enableCrossRowDragbooleanfalseEnable dragging blocks between rows
enableGhostPreviewbooleantrueShow a ghost/preview element following the cursor during cross-row block drag. Set to false to disable.
getGhostPreview({ action, row }) => ReactNode--Custom ghost preview during cross-row drag

Action Move Callbacks

PropertyTypeDescription
onActionMoveStart({ action, row }) => voidBlock starts moving
onActionMoving({ action, row, start, end }) => boolean | voidMoving — return false to cancel
onActionMoveEnd({ action, row, start, end }) => voidMovement ended

Action Resize Callbacks

PropertyTypeDescription
onActionResizeStart({ action, row, dir }) => voidResize started
onActionResizing({ action, row, start, end, dir }) => boolean | voidResizing — return false to cancel
onActionResizeEnd({ action, row, start, end, dir }) => voidResize ended

Click & Context Callbacks

PropertyTypeDescription
onClickRow(e, { row, time }) => voidRow single-click
onClickAction(e, { action, row, time }) => voidAction single-click
onClickActionOnly(e, { action, row, time }) => voidAction click — not when drag triggered
onDoubleClickRow(e, { row, time }) => voidRow double-click
onDoubleClickAction(e, { action, row, time }) => voidAction double-click
onContextMenuRow(e, { row, time }) => voidRow right-click
onContextMenuAction(e, { action, row, time }) => voidAction right-click

Row Drag Callbacks

PropertyTypeDescription
onRowDragStart({ row }) => voidRow drag started
onRowDragEnd({ row, editorData }) => voidRow drag ended — editorData is the reordered array

Drag Assist Lines

PropertyTypeDescription
getAssistDragLineActionIds({ action, editorData, row }) => string[]Custom list of action IDs to use as snap targets

Cursor Callbacks

PropertyTypeDescription
onCursorDragStart(time: number) => voidCursor drag started
onCursorDragEnd(time: number) => voidCursor drag ended
onCursorDrag(time: number) => voidCursor being dragged
onClickTimeArea(time, e) => booleanTime ruler click — return false to block cursor

Ref Handle (TimelineState)

MemberTypeDescription
targetHTMLElement | nullUnderlying DOM node
listenerEmitter<EventTypes>Engine event emitter
isPlayingbooleanWhether playing
isPausedbooleanWhether paused
setTime(time)(n: number) => voidMove cursor to time
getTime()() => numberGet current time
setPlayRate(rate)(n: number) => voidSet playback speed
getPlayRate()() => numberGet playback speed
reRender()() => voidRe-render at current time
play(param?)(p?: { toTime?, autoEnd?, runActionIds? }) => booleanStart playback
pause()() => voidPause playback
setScrollLeft(val)(n: number) => voidSet horizontal scroll
setScrollTop(val)(n: number) => voidSet vertical scroll

On this page