Model coin
The model in use as a coin: switching flips the mark on its axis while the name rolls over to the new one.
On this page
Switch models and the mark flips like a coin while the name rolls over and the chip eases to its new width.
Switch models and the coin flips on its vertical axis, the old mark on its face and the new one on its back, while the name rolls over to the new one and the chip eases to its new width. It only animates the change, so it works as the trigger of any model picker. Without a mark the coin shows the name's initials, in the model's own colour.
Installation
Usage
import { ModelCoin } from "@/components/ui/chatcn/model-coin"
<ModelCoin model={{ id: "opus", name: "Opus 5.5", mark: <YourMark /> }} trailing={<ChevronDownIcon />} />Examples
Tones
Six models, each coin in its own tone, so a model is known by its color before its name.
Props
| Prop | Type | Notes |
|---|---|---|
model | { id, name, mark?, tone? } | A new id plays the flip. tone colours the coin: blue, teal, purple, amber, green or red; by default each id keeps its own |
trailing | ReactNode | After the name, usually a chevron |
Accessibility
- A button whose text is the model's name; give it
aria-haspopupandaria-expandedfrom your picker. - The coin faces are decorative.
Motion
- A 520 ms flip in 3D (
perspective160 px), with both facesbackface-visibility: hidden. The name rolls 320 ms; the width eases 320 ms. - Reduced motion: the mark and name swap in place.