npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-audio-player.json --yesAudio player
ProA recording played in place, such as a meeting's audio on its notes, for React and Tailwind CSS. Part of Goop Pro.
This part takes no options of its own: it is set by what you put in it.
What an agent sees
import { useState } from 'react';
import { AudioPlayer } from '@/components/ui/goop/audio-player';
function VisitRecording() {
const [playing, setPlaying] = useState(false);
const [speed, setSpeed] = useState(1);
return (
<div className="flex flex-col gap-2">
<AudioPlayer
src="/recordings/visit.mp3"
aria-label="Visit recording"
duration={70}
speed={speed}
onSpeedChange={setSpeed}
onPlayingChange={setPlaying}
/>
<p className="text-sm text-muted-foreground">{playing ? 'Playing' : 'Paused'}</p>
</div>
);
}When to use
- A recording played in place, such as a meeting's audio on its notes.
Installation
Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Audio player on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-audio-player.json --yesAdd the Goop Audio player to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { useState } from 'react';
import { AudioPlayer } from '@/components/ui/goop/audio-player';
function VisitRecording() {
const [playing, setPlaying] = useState(false);
const [speed, setSpeed] = useState(1);
return (
<div className="flex flex-col gap-2">
<AudioPlayer
src="/recordings/visit.mp3"
aria-label="Visit recording"
duration={70}
speed={speed}
onSpeedChange={setSpeed}
onPlayingChange={setPlaying}
/>
<p className="text-sm text-muted-foreground">{playing ? 'Playing' : 'Paused'}</p>
</div>
);
}- Fits: record, chat: body.
- In a record's property band:
<Properties variant="band"><PropertyRow label="Audio"><AudioPlayer src={url} aria-label="Recording" /></PropertyRow></Properties>. Givedurationwhen you already know the length (your server's), so it shows before the file answers. - height, width, padding, gap, corner, text, motion: add no class for these.
API reference
- Each option with its sentence: audio-player--options.md
- State: speed (speed / defaultSpeed / onSpeedChange)
- data-slot values (to select a part by): audio-player, audio-player-mute, audio-player-play, audio-player-speed, audio-player-speed-number, audio-player-time, audio-player-timeline
AudioPlayer: every option
import { AudioPlayer } from '@/components/ui/goop/audio-player';Options
- src?: string — The recording's address, given to the player's
audioelement; none, and every control is off. - aria-label: string — The player's name for assistive technology.
- duration?: number — The length in seconds when you already know it, shown until the file says its own.
- disabled?: boolean = false — Off: every control faded and none answering.
- speeds?: readonly number[] — The speeds the menu offers, in order (default 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2).
- speed?: number — The playback speed, when you hold it; with
onSpeedChange. - defaultSpeed?: number = 1 — The playback speed at first, uncontrolled (default 1).
- onSpeedChange?: (speed: number) => void — Called with the speed chosen in the menu.
- onPlayingChange?: (playing: boolean) => void — Called when the recording starts (
true) and when it stops: paused or played to its end (false). - formatTime?: (seconds: number) => string — Seconds in words, for the two times and the scrubber's value (default
01:10,1:02:05). - formatSeekValue?: (time: string, duration: string) => string — What the scrubber says, from the two times in words (default
00:12 of 01:10). - playLabel?: string = 'Play' — The play button's name while stopped.
- pauseLabel?: string = 'Pause' — The play button's name while playing.
- muteLabel?: string = 'Mute' — The mute button's name;
aria-pressedsays whether it is on. - seekLabel?: string = 'Seek' — The scrubber's name.
- speedLabel?: string = 'Playback speed' — The speed menu's heading, and the speed button's name before the speed.
- menuProps?: ComponentProps<typeof DropdownMenu> — The speed menu's root props:
open,defaultOpen,onOpenChange,modal. - menuContentProps?: ComponentProps<typeof DropdownMenuContent> — The speed menu's panel props:
container,side,alignand the rest. - State: speed (speed / defaultSpeed / onSpeedChange)
Keyboard
| Key | What it does |
|---|---|
| Tab | Reach play, the scrubber, mute and speed in that order |
| Enter | On play: play or pause; on mute: mute or unmute; on speed: open its menu |
| Space | On play: play or pause; on mute: mute or unmute; on speed: open its menu |
| ArrowLeft ArrowRight | On the scrubber: seek a second back or on |
| PageUp PageDown | On the scrubber: seek ten seconds |
| Home End | On the scrubber: to the start or the end |
| ArrowUp ArrowDown | In the speed menu: move the lit row |
| Escape | In the speed menu: close, the focus back on the speed button |
Accessibility
- The native element answers the keyboard.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:
| State | Drawn by |
|---|---|
| disabled | the prop disabled |
Motion
- The part sets its own motion: add no transition or animation of your own.
Notes for AI
Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.