Skip to content
Sign upPro
Apps SDKDefinition cardMenu

Definition card (Pro)

ProIncluded in $99

A 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.

ProListen to hear it while the syllables light, switch part of speech, or follow a similar word.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/definition-card

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

tsx
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

ProA short entry, a misspelling with suggestions, and a lookup on its way.

Props

PropTypeNotes
word, syllables, ipa, langThe headword and how to say it
entriesDefinitionEntry[]{ pos, senses, synonyms?, antonyms? }
originReactNodeWhere the word came from
usage{ values, from, to }Use over time
onLookup(word) => voidMakes related words and suggestions buttons
loading, suggestionsOn the way, and not found
labelsPartial<DefinitionCardLabels>Every string, for translation

Keyboard

KeyAction
Arrow left, rightMove between parts of speech
EnterListen, 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.