Transcript viewer
A React component in Beamline's Voice & audio category.
A recording and its words together: the spoken word lights up as it plays and the transcript follows it, any word or paragraph time plays from there, speakers become paragraphs with marks on the scrub bar. Takes word timings from speech-to-text or character alignment from text-to-speech.
Use it for
- Call reviews, meeting recordings and voice notes with timed words.
- Playing generated speech with its text in step.
Not for
- A transcript without audio (a plain text block).
- Live captions of a call in progress (the voice-agent block shows those).
- Audio without words (audio-player).
Anatomy
- player row (play, title, speed)
- transcript (paragraphs: speaker, time button with a play mark that shows on attention, words)
- active word
- scrub bar with a mark per paragraph
Variants
- input: words (speech-to-text: text, start, end, speaker), alignment (text-to-speech: per-character times)
States
- paused
- playing (active word lit, transcript follows)
- following paused while you scroll: a pill at the bottom says where the spoken word is (Back to 0:42, with its direction) and brings it back; following resumes on its own after a few seconds
- audio tags shown as cues or hidden
- no words (empty state)
- audio failed (the player's error and retry)
- narrow room (under 20rem: the words take the full width under the speaker's avatar and name)
Keyboard
- Tab: play, speed, each paragraph's time button, the transcript (scrolls with arrows), the scrub bar
- A paragraph's time button plays from its start (Enter / Space)
- Scrub bar: ← → seek 5 s, Home / End, Space plays and pauses
- The Back to pill is a button (Enter / Space) at the end of the transcript's tab order while it shows
Motion
The spoken word's tint and underline is one plate that travels word to word as the audio plays (--pui-duration-fast); words turn from unspoken to spoken over --pui-motion-out; the transcript scrolls to keep the word in view (smoothly, or at once under reduced motion). The Back to pill rises in when the word leaves the view by hand. A word never breaks across lines, so the plate always covers one box.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
src (required) | string | — | The audio. |
words | TranscriptWord[] | — | Word timings from speech-to-text ({ text, start, end, speaker? }). |
alignment | CharacterAlignment | — | Or per-character timing from text-to-speech; it is turned into words. |
title / subtitle | string | — | title: Heading shown above the content. Defaults to "Recording". subtitle: Secondary text beneath the title. Defaults to no secondary text. |
hideAudioTags | boolean | — | Hides the non-speech audio tags; defaults to false. Deprecated: Use showAudioTags={false} instead. |
follow | boolean | true | Keep the spoken word in view. Default true. |
height | number | 240 | Height of the transcript in px; it scrolls inside. Default 240. |
onWordClick | (word: TranscriptWord) => void | — | Default: play from the word. |
classNames | TranscriptViewerClassNames | — | Classes for the named visual parts; no part overrides by default. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
playerClassNames | AudioPlayerClassNames | — | Classes for the player component's named parts; no overrides by default. |
showAudioTags | boolean | true | Includes non-speech audio tags in the transcript; defaults to true. Takes precedence over hideAudioTags. |
title | string | — | Heading shown above the content. Defaults to "Recording". |
subtitle | string | — | Secondary text beneath the title. Defaults to no secondary text. |
className | string | — | Classes on the documented visual root; no override by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
ref | Ref<HTMLDivElement> | — | Receives the documented root element; no ref by default. |
Built from
- audio-player
- scrub-bar
- avatar
- button
- empty-state
Used in
Dependencies
lucide-react
Import
import { TranscriptViewer } from "@beamline/transcript-viewer";
Get it
Transcript viewer is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent
More in Voice & audio
- Recorded answer: A spoken answer against a time limit: record (the microphone asked for first, a blocked one said with what to do), the running time against the limit…
- Orb: The agent's presence: a thin ring of light around a lens in the brand's hue that holds still at rest, sends an arc round while thinking and widens with…
- Call grid: The people on a video call, laid out for the room they are given: tiles as large as the space allows at the camera's shape, or the person talking (or a…
- Bar visualizer: A row of bars that says what a voice agent is doing: a sweep while connecting, the person's voice while listening, a slow breath while thinking, the…
- Matrix: A dot-matrix display: animated frame sets (loading, pulse, wave, syncing), text and digits in a 5×7 font, or a VU meter of levels or a live source. One…
- Waveform: The shape of a recording: one bar per slice of loudness, fitted to any width, with the played part in the accent, unmeasured slices hatched and a loading…
- Live waveform: Loudness drawn as it happens: a scrolling history of the microphone (or any live source) or its spectrum, a calm processing state while words are…
- Conversation bar: The control bar of a voice call with an agent: one button to call and hang up, the agent's state as bars, a call timer, mute, and typing when talking is…
- Audio player: One audio element and its controls: play with a loading state, a scrub bar with time, skip, speed and a playlist whose rows play into the same player…
- Voice button: The control that starts and stops talking: click to toggle or hold to talk (pointer, Space, Enter or a global shortcut), with a live level while…
- Scrub bar: A seekable timeline for audio or video: elapsed and total time, what has loaded, chapter marks, a time preview under the pointer, and the full keyboard…
- Speech input: A text field you can speak into: the mic dictates through any speech-to-text provider, the phrase being heard shows apart from the finished words, and…
- Voice picker: Choose a text-to-speech voice from a searchable list (name, accent, tone, use) and hear it first: each voice has its own orb, previews play one at a time…
- Microphone selector: Choose the microphone, test it with a live level and mute it, with every permission and device state spelled out: not yet allowed, blocked (and how to…