Time Model

How ef-timegroup controls timing, duration, and sequencing in a composition.

ef-timegroup is the core timing primitive. Every composition has at least one — the root group that defines the total video duration. Groups nest to build complex timelines.

duration

All time values are CSS time strings: 5s, 500ms, 2.5s.

mode="sequence"

Children play one after another. The group's total duration is the sum of its children's durations.

Interactive example

Sequence with overlapping transitions

Editframe timegroups support overlapping scenes — the foundation for transitions. Set overlap on a mode="sequence" to create a shared time window between adjacent scenes. Both scenes are active simultaneously during that window.

In order to use the overlap window for a transition, add CSS animations that reference the special timing variables --ef-transition-duration and --ef-transition-out-start.

To animate a transition into a scene, use --ef-transition-duration as the animation duration and start at 0s. To animate a scene out, use the same duration but start at --ef-transition-out-start to align with the end of the previous scene's overlap window.

Interactive example

mode="fixed"

Children overlap. Each element plays for its own duration, starting at an optional offset within the group.

Interactive example

offset shifts when an element begins within its parent fixed group.

mode="contain"

The group's duration matches the duration of the longest internal temporal element.

Interactive example

mode="fit"

The group's duration is set to be the duration of it's parent. This is useful for elements that should stretch to fill the entire composition, like a music track or background video.

This can be combined with a sequence to create a background track that automatically spans the full composition duration:

Interactive example

Timegroups vs Temporal Elements

Timegroups are the typical element to use to structure the timing of your composition, but they aren't the only temporal elements.

  • <ef-video>
  • <ef-audio>
  • <ef-image>
  • <ef-text>

Can typically used as direct children of a timegroup. This can sometimes be desirable to simplify your composition structure.

But the direct use of temporal elements without wrapping timegroups reduces the flexibility of including non-temporal content, such as graphics, text, or other html elements to to lay out content with css and html.

loop

Add loop to the root ef-timegroup to loop the composition in the browser preview:

html
<ef-timegroup duration="5s" loop class="w-[1920px] h-[1080px] bg-black">
  ...
</ef-timegroup>

loop has no effect during rendering — the renderer plays through exactly once.

fps

fps controls the frame rate used when scrubbing and rendering. It defaults to 30. Drag the slider to see how frame rate affects animation smoothness:

Interactive example