Rebar UI

1.0

opinion

VoiceComposer

A voice-message composer: a record button that changes with state, and an editable transcript.

Voice noteRecord, stop, edit the transcript, send
Ready to record.
Recording
00:12

Transcribing as you speak…

Recording
Transcribing
Transcribing…
Ready
Ready to send
Error

The microphone is blocked.

Error: The microphone is blocked.

In context

Crew chatReply to Jonas by voice
Mobile release
What slipped on the mobile release this week?
Two things. Offline sync is in review and the crew-interview notes are late.
Can you draft a note for the crew?
Ready to record.

Props

PropTypeRequiredDefault
stateVoiceComposerStateYes—
draftTextstring | undefinedNo—
onDraftTextChange((text: string) => void) | undefinedNo—
elapsedSecondsnumber | undefinedNo—
onStartRecording() => voidYes—
onStopRecording() => voidYes—
onSend() => voidYes—
onCancel() => voidYes—
errorMessagestring | undefinedNo—
bionicboolean | undefinedNo—
bionicOptionsBionicOptions | undefinedNo—

Presentational

No MediaRecorder inside: the caller records and transcribes, and drives the component with state and draftText. The draft is an editable textarea once ready.

data-rebar-* attributes

data-rebar-component="voice-composer"; parts include main-button, cancel-button, draft-textarea, elapsed-time.

Migrating to Ant Design

Not codemod-covered. Compose AntD's Button and Input.TextArea against the same state machine.