Transport

Timeline transport control for playback progress and scrubbing, with buffered range visualization, keyboard, wheel, and pointer interactions.

Timeline control for playback progress (current value + buffered range). The registry component wraps Transport primitives from @audio-ui/react with audio-focused defaults for player seek bars and scrub interactions.

Overview

  • Interaction model: Pointer drag on track/thumb, wheel stepping, keyboard nudging, and commit callbacks.
  • Visual model: Base track + buffered range + played range + thumb.
  • Playback UX: Supports freezeValuesWhileDragging to avoid jitter/flicker while scrubbing.
  • Accessibility: Thumb is exposed as role="slider" with aria-valuenow, aria-valuemin, and aria-valuemax.

Installation

Usage

import { Transport } from "@/components/audio/transport";

Controlled (typical in player UIs):

const [progress, setProgress] = useState(42);
 
<Transport
  aria-label="Playback position"
  bufferedValue={78}
  onSeek={setProgress}
  value={progress}
/>

Interaction

Pointer

BehaviorDetails
Track click / dragUpdates value from pointer position along the rail.
Thumb dragContinuous scrubbing, clamped to min...max.
Commit eventonValueCommit fires when drag interaction ends (primitive-level callback).

Keyboard

Focused thumb supports:

KeyAction
ArrowUp / ArrowRightIncrease by step
ArrowDown / ArrowLeftDecrease by step
PageUpIncrease by step × 10
PageDownDecrease by step × 10
HomeSet to min
EndSet to max

Wheel

When focused, wheel input nudges the value by step.

API reference

Transport keeps an audio-focused API (value, bufferedValue, onSeek) and forwards remaining root props to TransportPrimitive.Root.

Value and state

PropTypeDefaultDescription
valuenumber-Current transport value (typically 0..100).
bufferedValuenumber0Buffered position (same scale as value).
onSeek(nextValue: number) => void-Called when scrubbing or keyboard/wheel changes value.
freezeValuesWhileDraggingbooleanfalseFreezes rendered values during active drag for smoother visual feedback.
disabledbooleanfalseDisables interaction.
aria-labelstring-Accessible name for the slider.
aria-labelledbystring-ID of the associated label element.

For production usage, pass either aria-label or aria-labelledby explicitly.

Layout and behavior

PropTypeDefaultDescription
orientation"horizontal" | "vertical""horizontal" (registry wrapper)Direction of travel.
size"sm" | "default" | "lg""default"Thumb/rail density preset.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber1Quantization step for drag/wheel/keyboard.
classNamestring-Wrapper class name.

Examples

Basic transport timeline

Channel strip

Horizontal

Track 1
0:35 / 1:42

Vertical

Track 1
0:35 / 1:42

Last updated 4/15/2026