ef-timeline

Full timeline editor with tracks, playhead, ruler, and zoom.

Renders a multi-track timeline for the target composition. Includes a time ruler, per-element track rows, a draggable playhead, and built-in playback and zoom controls. Zoom state is persisted to localStorage keyed by the root timegroup ID.

AttributeReact propTypeDefaultDescription
follow-playheadfollowPlayheadbooleantrueAuto-scrolls the timeline to keep the playhead visible during active playback.
hierarchy-widthlabelWidthnumber160Width of the layer hierarchy panel in pixels.
pixels-per-secondpixelsPerSecondnumber100Zoom level — pixels rendered per second of composition time.
row-heightrowHeightnumber28Height of each track row in pixels.
targettargetstring""ID of the target element this component controls or reads from.
<ef-timegroup id="demo" mode="sequence" class="w-[1920px] h-[1080px] bg-slate-900">
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-indigo-900 flex items-center justify-center">
    <ef-text class="text-white text-7xl font-bold">Scene A</ef-text>
  </ef-timegroup>
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-rose-900 flex items-center justify-center">
    <ef-text class="text-white text-7xl font-bold">Scene B</ef-text>
  </ef-timegroup>
  <ef-timegroup mode="fixed" duration="2s" class="absolute w-full h-full bg-emerald-900 flex items-center justify-center">
    <ef-text class="text-white text-7xl font-bold">Scene C</ef-text>
  </ef-timegroup>
</ef-timegroup>

Use show-* attributes to control which panels are visible:

<!-- Timeline with all panels -->
<ef-timeline target="my-canvas" show-ruler show-hierarchy show-playback-controls show-zoom-controls></ef-timeline>

<!-- Ruler and playhead only -->
<ef-timeline target="my-canvas" show-ruler show-playhead></ef-timeline>

Keyboard shortcuts (when focused):

KeyAction
/ Step one frame
Shift+← / Shift+→Step one second
ScrollPan timeline
Cmd/Ctrl+ScrollZoom toward cursor

CSS Parts

PartDescription
scrub-overlayFull-area overlay capturing pointer drags while scrubbing.

ef-timeline does not itself expose a track part — the per-row clip lives on the nested ef-timeline-row element it renders internally:

PartDescription
barThe colored clip bar itself.
labelRow label area (element name, icon, detail text).
trackRow track area displaying the clip bar.
ef-timeline::part(playhead)  { background: #e94560; }
ef-timeline-row::part(track) { background: #1a1a2e; border-radius: 4px; }

CSS Custom Properties

Each row is rendered by an internal ef-timeline-row:

PropertyDefaultDescription
--trim-handle-widthOverrides the nested `<ef-trim-handles>`'s own `--trim-handle-width` for clips rendered inside this row.