Scrubber

A compact player: play and pause, the position, a seek bar and the length.

Audio UI

Installation

pnpm dlx shadcn@latest add @audio-ui/scrubber

Anatomy

The scrubber is a Timeline: its bar is the ruler, with a playhead for the fill and one for the thumb.

import { Timeline } from "@audio-ui/react";

<Timeline.Root>
  <Timeline.Ruler>
    <Timeline.Playhead /> {/* the fill */}
    <Timeline.Playhead /> {/* the thumb */}
  </Timeline.Ruler>
</Timeline.Root>

Usage

import { createSource } from "@audio-ui/react";
import { Scrubber } from "@/components/audio-ui/scrubber";

const position = createSource(0); // seconds; set it from your player's clock

<Scrubber
  duration={215}
  onPlayingChange={(playing) => (playing ? player.play() : player.pause())}
  onSeek={(seconds) => player.seek(seconds)}
  playing={isPlaying}
  source={position}
/>;

Keyboard

The bar holds a native <input type="range">: the arrow keys move it by a second, Page Up and Page Down by ten, Home and End go to the ends. It announces the position as a clock, such as "1:15".

API reference

Props · 6

More Shadcn Scrubber components

Browse 1 production-ready audio/ui Scrubber components for players, mixers, and synth interfaces. These examples use the headless primitives from @audio-ui/react and stay fully compatible with Shadcn Create so radius, color, and typography match your configured theme.

Browse all 1 Shadcn Scrubber components for copy-ready layouts, dashboards, and forms built with Tailwind CSS in the audio/ui library.

Built by Ouest Labs, the source code is available on GitHub.
RSS