Refined UI

An opinionated, customizable superset of shadcn/ui

AgentsPrimitivesSkillsSkins
Integration
Guides
  • Overview
  • Get started
  • Shadcn compatibility
  • Architecture
  • Agent surface
Agents
  • Action Bar
  • Audio Recorder
  • Audio VisualizerBetaBeta — the props contract is close to final, but small breaking changes can still land.
  • Chat Input
  • Chat Input Attachment
  • Chat Message
  • Chat Scene
  • Code Block Editor
  • Dynamic NotificationExpExperimental — the contract and the rendering can change without notice. Own the installed copy before shipping it.
  • Environment Variables
  • Inline Attachment
  • Markdown Block
  • Task List
  • Thread Rail
  • Tool Call
  • User Ask
Blocks
  • Chat
  • Theme toggle
  1. Agents
  2. AudioRecorder
Agents

AudioRecorder

Voice recorder with realtime waveform, duration, cancel, and submit controls.

Examples

Line waveform version

The recorder hosts any AudioVisualizer usage version. App-wide, repoint the one import in your owned audio-recorder.tsx (bars → line); per instance, compose explicit children and stand a part bound to the line version on useAudioRecorderContext, as here.

Composition

The preferred shape for composing the installed agent from its exported parts.

Parts

Exported compound parts from the installed source.

AudioRecorder
├── AudioRecorderTrigger
├── AudioRecorderVisualizer
├── AudioRecorderStatus
├── AudioRecorderDuration
├── AudioRecorderCancel
└── AudioRecorderSubmit

This agent installs from the audio-recorder registry. Install the bundle with the command above, or inspect the source below.

Registry command
npx shadcn@latest add http://127.0.0.1:3000/r/refined/audio-recorder.json
See registry manifest

Usage

import type { AudioRecording } from "@/components/refined-ui/audio-recorder";
import { AudioRecorder } from "@/components/refined-ui/audio-recorder";
​
type MastraAttachment = {
name: string;
contentType: string;
data: Blob;
};
​
export function Example({ addAttachment }: { addAttachment: (attachment: MastraAttachment) => void }) {
function handleRecordingComplete(recording: AudioRecording) {
addAttachment({
name: `voice-note.${recording.mimeType.includes("mp4") ? "m4a" : "webm"}`,
contentType: recording.mimeType,
data: recording.blob,
});
}
​
return <AudioRecorder onRecordingComplete={handleRecordingComplete} />;
}
​

Installed dependencies

Installed with this agent because the visible component depends on them; they are support files, not separate product surfaces.

Behavior hooksrc/registry/hooks/use-audio-recorder.tsHook
Waveform (AudioVisualizer, bars version)src/registry/sources/refined/audio-visualizer.tsxSupport

Raw code

Primary installed agent source

Component
src/registry/sources/refined/audio-recorder.tsx

Primitives

This agent composes these library primitives, installed under components/refined-ui/ui/*.

Buttoncomponents/refined-ui/ui/button.tsxLibrary slotPopovercomponents/refined-ui/ui/popover.tsxLibrary slotCommandcomponents/refined-ui/ui/command.tsxLibrary slot

On this page

  • Preview
  • Examples
  • Composition
  • Installation
  • Usage
  • Dependencies
  • Source
  • Primitives