Skip to content
Sign in
AudioPronunciation dictionaryMenu

Pronunciation dictionaryPro

Word to phoneme or alias rules with a test play per row.

ProSeven rules with a duplicate and unwrapped IPA flagged; play any row.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/pronunciation-dictionary

Usage

tsx
import { PronunciationDictionary } from "@/components/ui/chatcn/pro/pronunciation-dictionary"

<PronunciationDictionary rules={rules} onRulesChange={setRules} onTest={speak} onStop={stop} />

Say as swaps in another spelling; IPA gives exact sounds wrapped in slashes. The same word twice is flagged with the row it clashes with, since the first rule wins. Pass onTest to play a row through your voice; omit onRulesChange for a read only list.

Examples

States

ProRead only, a voice that fails, and no rules yet.

Props

PropTypeNotes
rules, onRulesChange{ id, word, kind, value }[]kind is alias or phoneme
onTest(rule) => Promise<void>Resolve when playback ends
onStop() => voidStops the playing row

Accessibility

  • Every field is named by its row; the play button names the word and turns into Stop while playing.
  • Checks show an icon and a sentence that says how to fix them.