Knit UI
GitHub

Playground

Loading playground…

true
Playground
<AudioRecorder
  size="md"
  controls
  options={RECORDING_PRESETS.HIGH_QUALITY}
/>

Examples

Default

Loading example…

DefaultSourceStorybook

With Meter

Metering enabled — the input-level bar tracks the microphone in real time.

Loading example…

With MeterSourceStorybook

Sizes

Loading example…

SizesSourceStorybook

Custom Layout

Compose a custom bar from the exported parts.

Loading example…

Custom LayoutSourceStorybook

Styles

Per-slot style overrides.

Loading example…

StylesSourceStorybook

Props

PropTypeDefaultDescription
controlsReactNodetrueThe control chrome. `true` (default) renders the built-in control bar; `false` renders no chrome; a node renders custom chrome inside the context.
getController((controller: AudioRecorderController) => void) | undefinedReceives the controller once ready.
labelstring | undefinedAccessible label for the recorder region. Default `"Audio recorder"`.
maxWidthnumber | Animated.AnimatedNode | GetThemeValueForKey<"maxWidth"> | null | undefinedFrame max width.
meteringEnabledboolean | undefinedEnable input-level metering. Overrides `options.isMeteringEnabled`.
onRecordingChange((isRecording: boolean) => void) | undefinedFired whenever recording starts/stops.
onStop((uri: string | null) => void) | undefinedFired when a recording is finalized, with its file URI.
optionsRecordingOptions | undefinedFull recording options. Defaults to the `HIGH_QUALITY` preset.
size system"xxs" | "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | undefined
xs · sm · md · lg · xl
mdControl sizing scale. Default `'md'`.
styles systemSlotStyles<AudioRecorderStyles> | undefinedPer-slot style overrides.
testIDstring | undefined
widthnumber | GetThemeValueForKey<"width"> | Animated.AnimatedNode | null | undefinedFrame width.

Style slots

Every part of AudioRecorder can be styled through the styles prop. Explicit props on the component always win over slot styles.

SlotUsage
controlBarstyles={{ controlBar: { … } }}
durationstyles={{ duration: { … } }}
meterFillstyles={{ meterFill: { … } }}
meterTrackstyles={{ meterTrack: { … } }}
rootstyles={{ root: { … } }}