People deck Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/people-deckPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/people-deck/ with the shared foundation.
Usage
import { PeopleDeck } from "@/components/mu/people-deck/PeopleDeck";
<PeopleDeck
people={[
{ photo: "/team/ana.avif", name: "Ana", role: "Design", line: "Draws on everything." },
{ photo: "/team/bo.avif", name: "Bo", role: "Engineering", line: "Ships on Fridays." },
]}
/>Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/people-deckOptional. An AI agent in your app can read and set this piece by name, and you can ask before anything it can’t undo. The piece itself doesn’t change; installs with your Pro key, like the piece. Built on UI SDK 0.1.0-beta.23, which is in beta too, so this add-on follows its releases.
Source
How it works
Building with an agent? Hand it a ready prompt for this piece.
Input and reduced motion
- Pointer / touch: drag the top card: it follows your hand exactly and turns as it goes. Let go past a third of its width, or with a flick, and it flies on and goes to the back while the next card rises; let go short and it springs home. On touch, a vertical drag scrolls the page. Escape while holding puts the card back.
- Keyboard: the two keys under the deck throw the top card on or bring the last one back; with either focused, → and ← do the same. Each change is read out politely ("Kitsu, 2 of 7").
- Reduced motion: the drag still tracks; a throw, a return and the rise land at once.
Props
| Prop | Default | What it does |
|---|---|---|
people | [] | PeopleDeckPerson[] | the cards, in order: photo (URL), name, and optional role, line and alt; an empty list is the empty state |
index | — | 0 to people.length − 1 | the person on top, when you hold it in your state |
defaultIndex | 0 | 0 to people.length − 1 | the person on top at first, when the deck holds it |
onIndexChange | — | (index) => void | called after every throw, button and arrow key, never as an echo of index |
loading | false | boolean | the deck's shape with no faces, while your people load (aria-busy) |
labels | English | Partial<PeopleDeckLabels> | deck, previous, next, empty, loading, and position ("{name}, {n} of {of}", read out on each change) |
sound | off | true or 0–1 | a soft swish as a card is thrown (see Sound) |
className | — | — | added to the root |
Sound
None. It loads in silence.
Off unless you pass sound (true, or a volume 0–1). A short swish plays as a card is thrown, by a hand, a button or an arrow key; it never plays on hover, on mount or when index changes from your state. setMuted(true) from components/mu/sounds.ts silences every cottoncandy item at once.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
Big portrait cards you swipe through: drag the top one away and it flies off, and the next rises from the deck.
For dating, hiring and profile browsingMore in People & nearby