Built for Web Awesome applications, this component uses Web Awesome controls, themes, and design tokens to provide a consistent timeline surface. Explore focused examples: a Studio-style controlled timeline, external time and zoom sliders, readonly playback, range editing, slots, and event-driven updates.
Demo 01 · Studio integration
Control the timeline from the host
Ready
The timeline stays controlled by its host. The standard time, transport, loop, and zoom controls remain inside the component. The play button emits a playback intent, then the host clock advances currentTimeMillis. The host also controls playback speed at 1×, 2×, or 5× through the top menu slot. Play opens a draggable Three.js Pac-Man companion that eats the clips in chronological order. When the next clip starts on another track, Pac-Man changes lane and leaves the current clip shortened.
The timeline is controlled by the host application. The component emits playback and seek requests, while the host clock writes the resulting position back through currentTimeMillis.
Use the top menu to move the playhead by ten seconds.
Use Shuffle in the top menu to redistribute the clips and reorder the current tracks.
Use the loop button in the transport area to repeat the selected range.
Drag the generated sources to create video, audio, text, or other clips.
Use the standard time and zoom controls rendered by the component.
Play the timeline to open the draggable Pac-Man view. Fully eaten clips disappear and increase the counter; clips interrupted by a lane change stay shortened and do not count.
External clip source
Drag a clip to the timelineFour generated clips are always ready: video, audio, text, and other. Drop one into a compatible track to choose its position; a replacement of the same type appears immediately.
Shuffle tracks and clipsx1x2x5
-10s
Back 10 seconds
+10s
Forward 10 secondsPreparing timeline...
Three.js playback companion
Pac-Man eats the clips
Drag me
Sound onMusic on
Press play in Demo 01. Pac-Man eats clips in chronological order. If the next clip starts on another track first, Pac-Man changes lane and leaves the current clip shortened. The counter includes only clips eaten to their end; the run is lost when at least half of the clips are almost eaten. At the end of the demo, Pac-Man smiles if the run is not lost and frowns after a loss.
Last eventNone
What to observe
The host receives seek intent and writes event.detail.timeMillis back to the component. It also owns the playback clock: play starts it, pause stops it, each frame updates currentTimeMillis, and the selected rate changes elapsed time without moving the playhead. The standard time and zoom controls stay inside the component. The top menu slot contains shuffle, playback speed, and 10-second seek controls. Shuffle redistributes the existing clips and reorders the current tracks without creating new ones. The clip sources are outside the custom element, so they can live in a toolbar, palette, or application menu. Four generated clip sources stay available for dragging, and each accepted drop replaces its source with a new one.
Drag one of the four clip types onto the timeline. Each accepted drop creates a replacement of the same type.
This simplified excerpt uses the same controlled clock as the timeline. Three.js renders the miniature ruler and clips, while the current time selects the clip to visit, moves Pac-Man from its start toward its end, and reduces the remaining clip width. Web Audio generates the chomp effect and an arcade-inspired fallback loop.
Drag or trim a clip, double-click a track label, or use the playback toolbar. Right-click a track to open its context menu. Use Show marker line to reveal the marker rail, then use Add Marker From API to append an editable, movable marker. The host advances the clock after a play event, so this demo shows the same integration pattern as the Studio example. Every interaction emits a namespaced event; this demo writes accepted track and marker changes back to the element.
This example focuses on editing and event handling. Move or trim a clip, use the scissors tool to preview and commit a cut, edit a track name, open the track context menu, change visibility, and inspect the serialized event detail in the fixed-height event panel.
Apply event.detail.tracks when a clip or track edit is accepted.
Use timeline.on(name, {before, on, after}) when an action needs validation or persistence.
The host playback clock continues to own currentTimeMillis.
Track actions are contextual: Edit applies to visible editable rows, while Hide/Show and Remove follow the track configuration.
In cut mode, hover an eligible clip to see the dashed guide and compact duration overlay, such as 1s500ms/3s [2s500ms], then click to split it; use Shift + click for consecutive cuts.
Use the Undo and Redo buttons in the tools bar to move through up to 200 committed edits; the host can accept each undo or redo event through its resulting tracks.
The timeline is a readonly playback projection: the host controls and sends the current time through an external player control. Inside the timeline, only the playhead grip can move. Use this pattern for a video player, a presentation preview, or a monitoring screen.
Readonly mode is useful when another component owns the timeline data and current position. The host keeps sending the external player position, while the timeline exposes playback controls, fixed start/end range handles, the draggable playhead grip, and standard clip icons.
Use the readonly attribute with playback.transport = 'hidden' and playback.time = 'hidden' when the host owns the controls.
Use options.mode = 'passive' for a passive projection, or options.mode = 'review' when playback and review navigation should remain available without editing.
Keep the external player's time slider outside the timeline.
Use this pattern for monitoring views, review screens, or compact sequence summaries.
Drag the colored start and end handles on the ruler. The playback clock stops at the selected end, which is useful when the timeline represents an in and out range. Keyboard users can focus the handles and move them with the arrow keys.
The selected range defines the portion of the timeline that can be played. The light-blue ruler area shows the portion that will actually be recorded or played back.
Drag the green start handle and red end handle to change the range.
Use the timeline transport to inspect the current position inside the selected range.
The host updates the playback clock when a range change is committed.
The component owns the timeline surface while the application owns its context: the temporal slider in time-slider, footer controls in timeline-controls and footer, and application actions in custom-menu. The full slot reference is available in the documentation.
Slots let the host place application controls around the timeline without coupling those controls to the component implementation.
time-slider replaces the temporal slider in the playback row.
timeline-ruler places content above the time ruler.
timeline-controls adds controls alongside the built-in zoom controls in the footer.
custom-menu adds host actions to the timeline header.
overlay-text replaces the initial construction message.
footer adds application content at the bottom of the timeline.
Focus the timeline surface, a range handle, a clip, a clip trim handle, or the legend divider, then use the matching shortcuts below. The divider shows the brand state while it is focused or being resized. The live status line records the last key pressed inside the Studio-style timeline.
The keyboard model follows the same controlled event flow as pointer interaction. Focus determines the target, and the timeline reports the resulting action through its namespaced events.
Use the timeline surface for playback, range navigation, scrolling, and zoom.
Focus a playhead or range handle for frame-sized movement.
Focus a clip to move, trim, duplicate, mask, enable, or delete it.
Click the Studio timeline, then press a shortcut.
Timeline keyboard shortcuts
Focus or context
Keys
Action
Timeline surface
Space
Toggle local playback.
Timeline surface
Home · End
Move the playhead to the selected range start or end. Press Home, then Space, to play from the range start.
Timeline surface
Shift + ← / →
Move the playhead to the selected range boundary.
Timeline surface
Shift + ↑ / ↓
Scroll tracks to the top or bottom.
Timeline surface
↑ / ↓
Increase or decrease row height.
Timeline surface
← / →
Zoom the ruler horizontally when no clip is selected.
Scrollbar rail
PageUp · PageDown · ↑ / ↓
Scroll one viewport in the focused direction.
Playhead grip
← / →
Move by keyboardStepSeconds.
Playhead grip
Shift + ← / →
Move by ten keyboard steps.
Playhead grip
Alt + → / ←
Jump to the range minimum or maximum.
Range handle
← / →
Move the focused boundary by one keyboard step.
Range handle
Shift + ← / →
Move the focused boundary by ten keyboard steps.
Clip
← / →
Move the selected clip by one rendered pixel.
Clip
Alt + ← / →
Move the selected clip by ten rendered pixels.
Clip
Delete · Backspace
Delete the focused editable clip.
Clip
Mod + C
Start a copy placement ghost; click to place it.
Clip
Mod + D
Duplicate the clip immediately after itself.
Editable timeline
Mod + K
Cut every eligible clip at the current playhead.
Editable timeline
Mod + Z
Undo the latest committed edit.
Editable timeline
Mod + Shift + Z · Mod + Y
Redo the latest undone edit.
Clip
M
Mask or reveal the clip.
Clip
V
Enable or disable the clip.
Non-movable clip
Enter · Space
Select the clip.
Clip trim handle
← / →
Trim the focused edge by one keyboard step.
Clip trim handle
Shift + ← / →
Trim the focused edge by ten keyboard steps.
Any active edit
Escape
Cancel a copy, drag, trim, cut mode, or context menu; clear clip selection.
Legend divider
← / →
Resize the track legend.
Legend divider
Shift + ← / → · Home · End · Enter
Change the resize step, select the minimum or maximum, or collapse and restore the legend.
Track label editor
Enter · Escape
Commit or cancel the label edit.
Mod means Ctrl on Windows and Linux, and ⌘ on macOS. Wheel gestures are also available on the timeline surface: Shift or Alt + wheel changes row height, while Meta + wheel changes horizontal ruler zoom. Ctrl + wheel remains available to the browser.
timeline.options = {
keyboardZoomActive: true,
keyboardStepSeconds: 0.1,
}
timeline.addEventListener('lgs1920-timeline-seek', event => {
timeline.currentTimeMillis = event.detail.timeMillis
})
// The component handles the shortcuts according to the focused part.
// The host only needs to keep controlled state synchronized.