> ## Documentation Index
> Fetch the complete documentation index at: https://api.fanvue.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# VoiceNote

> A voice-note audio player: a play/pause control, an amplitude waveform, and a timestamp — for voice messages and audio attachments in a conversation.

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";
import type { VoiceNoteProps, VoiceNoteSize, VoiceNoteVariant } from "@fanvue/ui";
```

## Examples

## Default

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-voicenote--default&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="220" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="VoiceNote — Default" />
</Frame>

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";

<VoiceNote time="0:05" />
```

## Negative

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-voicenote--negative&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="220" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="VoiceNote — Negative" />
</Frame>

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";

<VoiceNote time="0:02" negative progress={0.4} playing />
```

## Small

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-voicenote--small&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="220" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="VoiceNote — Small" />
</Frame>

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";

<VoiceNote time="0:05" size="small" />
```

## With File Name

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-voicenote--with-file-name&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="220" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="VoiceNote — With File Name" />
</Frame>

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";

<VoiceNote time="0:05" fileName="audio_name.mp4" />
```

## Player

<Frame>
  <iframe src={"https://main--697a1b6dd4dad73ee9c0e5f5.chromatic.com/iframe.html?id=components-voicenote--player&viewMode=story&shortcuts=false&singleStory=true&globals=theme:light"} width="100%" height="220" style={{border: "none", borderRadius: "8px"}} loading="lazy" title="VoiceNote — Player" />
</Frame>

```tsx theme={null}
import { VoiceNote } from "@fanvue/ui";

<VoiceNote src="https://example.com/voice-note.mp3" duration={24} />
```

## Props

## VoiceNote

A voice-note audio player: a play/pause control, an amplitude waveform, and a timestamp — for voice messages and audio attachments in a conversation.

Two modes: pass `src` for a self-contained player that decodes the waveform, plays real audio, tracks live progress and is seekable; or omit `src` and drive it with `playing`/`progress` + `onPlayPause` for a presentational, fully-controlled voice note. `flat` renders a compact dotted preview and `negative` adapts it to dark message bubbles.

<ParamField path="aria-label" type="string" default="Voice note">
  Accessible name for the whole player.
</ParamField>

<ParamField path="defaultPlaying" type="boolean" default="false">
  Initial playing state (uncontrolled).
</ParamField>

<ParamField path="duration" type="number">
  Fallback total duration (seconds), used until the media's metadata loads.
</ParamField>

<ParamField path="fileName" type="string">
  File name shown when the audio is an uploaded file rather than a voice note.
</ParamField>

<ParamField path="negative" type="boolean" default="false">
  Dark-surface treatment for use on message bubbles.
</ParamField>

<ParamField path="onEnded" type="(() => void)">
  Called when audio playback reaches the end (only in `src` mode).
</ParamField>

<ParamField path="onPlayPause" type="((playing: boolean) => void)">
  Called with the next playing state when the play/pause control is pressed.
</ParamField>

<ParamField path="onRemove" type="(() => void)">
  Called when the remove button is pressed.
</ParamField>

<ParamField path="playButtonLabel" type="string">
  Accessible name for the play/pause control. Defaults to "Play"/"Pause".
</ParamField>

<ParamField path="playing" type="boolean">
  Whether audio is playing (controlled) — toggles the play/pause icon.
</ParamField>

<ParamField path="progress" type="number">
  Playback progress (0–1) for the presentational mode. When set, the waveform splits into played/unplayed bars (the "Listening" state). Ignored when `src` is set (progress comes from the media element).
</ParamField>

<ParamField path="removeButtonLabel" type="string" default="Remove">
  Accessible name for the remove button.
</ParamField>

<ParamField path="showControls" type="boolean" default="true">
  Show the play/pause control.
</ParamField>

<ParamField path="showRemove" type="boolean" default="false">
  Show a remove button (calls `VoiceNoteProps.onRemove`).
</ParamField>

<ParamField path="showTimestamp" type="boolean" default="true">
  Show the timestamp label.
</ParamField>

<ParamField path="size" type="&#x22;small&#x22; | &#x22;default&#x22;" default="default">
  Size preset.
</ParamField>

<ParamField path="src" type="string">
  URL of the audio to play. When set, the component manages a real `<audio>` element: it decodes the waveform, plays/pauses, tracks live progress and is seekable — `waveform`/`progress` are derived automatically. Leave unset for a presentational, fully-controlled voice note.
</ParamField>

<ParamField path="time" type="string">
  Timestamp or duration label, e.g. "0:05". Ignored when `src` is set (derived from the media).
</ParamField>

<ParamField path="variant" type="&#x22;flat&#x22; | &#x22;default&#x22;" default="default">
  Visual style; `flat` renders a simplified dotted preview.
</ParamField>

<ParamField path="waveform" type="number[]">
  Amplitude values (0–1), one per bar. Ignored when `src` is set. Falls back to a built-in pattern.
</ParamField>

## Exported types

Also exported from `@fanvue/ui`: `VoiceNoteProps`, `VoiceNoteSize`, `VoiceNoteVariant`.

***

**Setup:** [Installation](/docs/ui/installation) · [Theming](/docs/ui/theming)
