A recording and its transcript together: the spoken line lights up, any line's time plays from there, search marks matches.
- 6.5 kB JS 5.0 kB CSS gzipped
- No serious axe issues
- Server-rendered, hydrates
- 44px touch targets
- Right-to-left
- 14 tests
Standup, 4 March
- Ada Okafor38%
- Wei Chen32%
- Priya Raman31%
- Ada Okafor
Morning. Quick one today. Wei, how's the export fix?
- Wei Chen
It's merged. The timeout came from a missing index on export jobs. Exports now finish in under two seconds.
- Ada Okafor
Great. Are any customers still waiting?
- Wei Chen
Three. I'll rerun their jobs this morning and reply on each ticket.
- Priya Raman
I can take the replies, if you send me the ticket numbers.
- Ada Okafor
Perfect. Priya, where are we on the checkout redesign?
- Priya Raman
The review notes are in. The pay button color and the contrast on the terms line are fixed. Card marks land tomorrow.
- Ada Okafor
Then let's ship it on Thursday. Thanks, everyone.
import type { Html } from "effect/ui/html"import * as stylex from "@stylexjs/stylex"import { TranscriptPlayer } from "./ui/uicontext/components/TranscriptPlayer.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { standup, standupAudio } from "./standup.ts"const styles = stylex.create({ wrap: { inlineSize: "min(100%, 44rem)" } })// press Play, or a line's time to hear it; search for "export"export const Standup = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.wrap)).children( TranscriptPlayer(h, { key: "standup", props: { label: "Standup, 4 March", src: standupAudio, segments: standup } }), )When to use
A recording and its transcript together: the spoken line lights up, any line's time plays from there, search marks matches. Use Read Aloud instead when there's no recording, only text to speak.
Usage
import { TranscriptPlayer, type TranscriptSegment } from "./ui/uicontext/components/TranscriptPlayer.ts"export const Recording = <M>(h: Html.H<M>, src: string, segments: ReadonlyArray<TranscriptSegment>) => TranscriptPlayer(h, { props: { label: "Customer call", src, segments } })Examples
Beside the notes
In a narrow column the controls wrap and the lines keep their times.
Standup notes
4 March · Ada, Wei, Priya
- Export timeout fixed: a missing index. Exports under 2 s.
- Wei reruns three customers' jobs; Priya replies on their tickets.
- Checkout redesign: review notes fixed, card marks tomorrow.
- Ship checkout on Thursday.
Recording
- Ada Okafor38%
- Wei Chen32%
- Priya Raman31%
- Ada Okafor
Morning. Quick one today. Wei, how's the export fix?
- Wei Chen
It's merged. The timeout came from a missing index on export jobs. Exports now finish in under two seconds.
- Ada Okafor
Great. Are any customers still waiting?
- Wei Chen
Three. I'll rerun their jobs this morning and reply on each ticket.
- Priya Raman
I can take the replies, if you send me the ticket numbers.
- Ada Okafor
Perfect. Priya, where are we on the checkout redesign?
- Priya Raman
The review notes are in. The pay button color and the contrast on the terms line are fixed. Card marks land tomorrow.
- Ada Okafor
Then let's ship it on Thursday. Thanks, everyone.
import type { Html } from "effect/ui/html"import * as stylex from "@stylexjs/stylex"import { TranscriptPlayer } from "./ui/uicontext/components/TranscriptPlayer.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { color, font, space } from "./ui/uicontext/components/tokens.stylex.ts"import { standup, standupAudio } from "./standup.ts"const styles = stylex.create({ page: { display: "grid", gridTemplateColumns: { default: "minmax(0, 1fr) minmax(0, 22rem)", "@media (max-width: 760px)": "minmax(0, 1fr)" }, gap: space.xl, alignItems: "start", inlineSize: "100%", }, notes: { display: "grid", gap: space.sm, fontSize: font.sm, color: color.fg }, heading: { margin: 0, fontSize: font.lg, fontWeight: 600 }, list: { margin: 0, paddingInlineStart: space.lg, display: "grid", gap: space.xs }, meta: { margin: 0, color: color.muted },})// meeting notes with the recording beside them, so any point can be checked against what was saidexport const MeetingNotes = <M>(h: Html.H<M>) => h.div.attrs(sx(styles.page)).children( h.article.attrs(sx(styles.notes)).children( h.h2.attrs(sx(styles.heading)).children("Standup notes"), h.p.attrs(sx(styles.meta)).children("4 March · Ada, Wei, Priya"), h.ul.attrs(sx(styles.list)).children( h.li.children("Export timeout fixed: a missing index. Exports under 2 s."), h.li.children("Wei reruns three customers' jobs; Priya replies on their tickets."), h.li.children("Checkout redesign: review notes fixed, card marks tomorrow."), h.li.children("Ship checkout on Thursday."), ), ), TranscriptPlayer(h, { key: "notes", props: { id: "notes-recording", label: "Recording", src: standupAudio, segments: standup } }), )API reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | What the recording is: "Standup, 4 March". |
srcrequired | string | — | The audio, or a video played for its sound. |
segmentsrequired | TranscriptSegment[] | — | — |
id | string | "transcript" | Starts the ids inside it, unique on the page; "transcript" by default. |
locale | string | — | For counts and shares; the browser's by default. |
Installation
pnpm dlx shadcn@latest add checkfu/uicontext/transcript-player