Definition card (Pro)
ProIncluded in $99A dictionary entry that sounds the word out: syllables that light as it is spoken, parts of speech as tabs, examples, similar words and where it came from.
On this page
Installation
Needs chatcn Pro
This command works with a Pro license, along with every Pro component.
Or start free: sign up and get three Pro components on us, with a new one every month.
Usage
import { DefinitionCard } from "@/components/ui/chatcn/pro/definition-card"
<DefinitionCard
word="ephemeral"
syllables={["e", "phem", "er", "al"]}
ipa="ɪˈfɛm(ə)rəl"
entries={[{
pos: "adjective",
senses: [{ meaning: "Lasting for a very short time.", example: "Fashions are ephemeral." }],
synonyms: ["fleeting", "transient"],
}]}
origin="Late 16th century: from Greek ephēmeros, “lasting only a day”."
onLookup={(word) => lookUp(word)}
/>The headword is spelt in syllables with its IPA. Listen speaks it with the browser's voice for lang, slowed a little, and each syllable lights in turn; speech engines don't report syllables, so the highlight keeps an even beat close to a careful reading. Parts of speech are tabs, senses are numbered with a tag such as botany and an example under each. With onLookup, similar and opposite words become buttons that open their own entry, which is how the demo follows fleeting to its page. origin and usage close the card; usage is a small line of how often the word appears in print between two years. With no entries it says nothing was found and offers suggestions.
Examples
States
Props
| Prop | Type | Notes |
|---|---|---|
word, syllables, ipa, lang | The headword and how to say it | |
entries | DefinitionEntry[] | { pos, senses, synonyms?, antonyms? } |
origin | ReactNode | Where the word came from |
usage | { values, from, to } | Use over time |
onLookup | (word) => void | Makes related words and suggestions buttons |
loading, suggestions | On the way, and not found | |
labels | Partial<DefinitionCardLabels> | Every string, for translation |
Keyboard
| Key | Action |
|---|---|
| Arrow left, right | Move between parts of speech |
| Enter | Listen, or look up a word |
Accessibility
- The heading reads the word whole; the dotted spelling is hidden from screen readers.
- Parts of speech follow the tabs pattern; Listen is a toggle.
- Examples carry the entry's
lang.
Motion
Syllables light for 210 ms each; a new part of speech rises in. Reduced motion keeps the highlight and drops the rise.