# AudioEmbed

Audio player card with native controls, title and transcript slot

> Component ID: `audio-embed`
> Import: `import { AudioEmbed } from '@slipstream-ui/core'`
> Docs: https://slipstreamui.com/docs/components/audio-embed
> Registry: https://slipstreamui.com/registry/audio-embed.json
> Tier: molecule · Package: @slipstream-ui/core@0.16.0
> Manifest schema: v1 · manifest: v1

## 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.

## Props

| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
| src | `string` | — | yes | Audio file URL (mp3/ogg/m4a) hosted by the consumer |
| title | `string` | — | yes | Visible title and accessible name for the player |
| description | `string` | — | no | Supporting line under the title (episode summary, duration) |
| transcript | `ReactNode` | — | no | Transcript link or inline text — provide one for meaningful audio |
| artwork | `ReactNode` | — | no | Cover art slot rendered beside the player on wider screens |
| className | `string` | — | no | Additional CSS classes to apply |

## Examples

### Podcast episode

Native controls, summary line and transcript link

```tsx
<AudioEmbed
  src="/episodes/1.mp3"
  title="Episode 1: Foundations"
  description="A walkthrough of the core primitives."
  transcript={<a href="/episodes/1/transcript">Read the transcript</a>}
/>
```

## Anti-patterns

- **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.
- **Don't skip the transcript** — Meaningful audio needs a text alternative. Provide transcript as a link or inline text.

## Accessibility

- **Keyboard playback**: Native <audio controls> is fully keyboard operable
- **Named player**: The audio element carries aria-label={title} and the title renders visibly
- **Text alternative**: The transcript slot renders consumer-provided text or a link

## Composition

- Compose with **VideoTestimonial** — Sibling media-proof components; VideoTestimonial adds video + attribution, AudioEmbed is the audio-only card
  
  ```tsx
  <AudioEmbed ... /> vs <VideoTestimonial ... />
  ```
- Compose with **CoverImage** — artwork accepts any node — CoverImage gives episode art a seeded fallback
  
  ```tsx
  artwork={<CoverImage seed={episode.slug} className="h-16 w-16 rounded-lg" />}
  ```
- Related: VideoTestimonial, CoverImage, Media

