AudioEmbed
Consumer-hosted audio in a card: native <audio controls> (keyboard accessible, preload=none), title, description and transcript slot.
Design intent
AudioEmbed wraps a consumer-hosted audio file in a card with native <audio controls> — keyboard accessible and never autoplaying — plus a title and a transcript slot for the text alternative WCAG expects for meaningful audio.
npx @slipstream-ui/cli@latest add audio-embedDemo: a short tone
A generated 0.4s sine wave proving the player works.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | Audio file URL (mp3/ogg/m4a). |
| title | string | — | Visible title and accessible name for the player. |
| description | string | — | Supporting line under the title. |
| transcript | ReactNode | — | Transcript link or inline text. |
| artwork | ReactNode | — | Cover art slot beside the player. |
| className | string | — | Additional CSS classes to apply. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't autoplay
The component never sets autoplay — audio that starts on page load is hostile and fails WCAG. Keep it that way for custom players too.
tsx// Avoid<audio src="..." autoPlay />// Prefer<AudioEmbed src="..." title="..." />Don't skip the transcript
Meaningful audio needs a text alternative. Provide transcript as a link or inline text.
tsx// Avoid<AudioEmbed src="ep.mp3" title="Ep 1" />// Prefer<AudioEmbed src="ep.mp3" title="Ep 1" transcript={<a href="/ep-1-transcript">Transcript</a>} />
Accessibility
- Native <audio controls> is fully keyboard operable and never autoplays.
- The audio element carries aria-label={title}; keep the title specific.
- Provide a transcript for speech-heavy episodes.
Content guidelines
Titles
- Use the episode/article title verbatim
- Descriptions add one line of context, not a summary essay
Good examples
- Episode 12: Design systems at scale
- 40 min · with Sarah Chen
Bad examples
- Audio file
- Click here to listen!!!
Composition
Compose with VideoTestimonial: Sibling media-proof components; VideoTestimonial adds video + attribution, AudioEmbed is the audio-only card
<AudioEmbed ... /> vs <VideoTestimonial ... />
Compose with CoverImage: artwork accepts any node — CoverImage gives episode art a seeded fallback
artwork={<CoverImage seed={episode.slug} className="h-16 w-16 rounded-lg" />}
Related components: VideoTestimonial, CoverImage, Media
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.