# Synced Transcript

A transcript that follows the spoken word, lets you click any word to jump there, and waits when you scroll away.

## Installation

Synced Transcript is a free, open-source React component in the Kokonut UI [Media collection](/content/docs/media/index.html). Add it with the shadcn CLI, which copies the source into `components/kokonutui/synced-transcript.tsx`, so the code is yours to change.

```
npx shadcn@latest add @kokonutui/synced-transcript
```

Or add it by hand: install its packages, then copy the source from above into `components/kokonutui/synced-transcript.tsx`.

```
npm install lucide-react
```

## Usage

```
import SyncedTranscript from "@/components/kokonutui/synced-transcript";

export default function Example() {
  return <SyncedTranscript />;
}
```

## Props

- `title`
  - `string` Default: "Frame Rate · Episode 48"
- `segments`
  - `TranscriptSegment[]` Default: built-in
- `duration`
  - `number` Seconds. Defaults to the end of the last segment. Playback is simulated; drive it from your own audio with `onTimeChange`.
- `onTimeChange`
  - `(seconds: number) => void`
- `className`
  - `string` Extra classes for the root element.

### TranscriptSegment

- `speaker` required
  - `string`
- `start` required
  - `number` Seconds from the start.
- `end` required
  - `number`
- `text` required
  - `string`

## Dependencies

| Needs                     | Version  | Comes from                  |
|---------------------------|----------|-----------------------------|
| `lucide-react`            | `^0.556.0` | npm, installed by the CLI   |
| `cn` from `lib/utils.ts` |          | shadcn init                 |
| React                     | `19`     | Your app                    |
| Tailwind CSS              | `4`      | Your app                    |

No provider, font or global CSS to set up: the file works as soon as it lands.
