Flap picker Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/flap-pickerPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/flap-picker/ with the shared foundation.
Usage
import { FlapPicker } from "@/components/mu/flap-picker/FlapPicker";
<FlapPicker people={team} onPick={(person) => saveRound(person.id)} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/flap-pickerOptional. 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: press the button; its hit area is 44px. While it spins the button stays focusable but ignores presses (
aria-disabled). - Keyboard: Tab to the button, Enter or Space to spin.
- Reduced motion: no roulette and no band; the line says "Picking…" while it waits, then the face and the name swap in place. It ends exactly where full motion ends.
- Off screen: scrolled away mid-spin, the tiles land at once and nothing runs.
Props
| Prop | Default | What it does |
|---|---|---|
people | [] | { id, name, photo }[] | the team; a name shows on up to 8 flaps, a photo is a face crop's URL (512px square covers every size) |
onPick | — | (person) => unknown | runs as a spin starts, with the person it means to land on; return a promise and it keeps spinning until it settles; resolve with an id to land on that person instead; reject and it says so |
pick | — | an id | forces the result: every spin lands there, and a new value spins to it (silently, with no onPickChange echo) |
defaultPick | — | an id | who is shown picked at first, uncontrolled |
onPickChange | — | (id) => void | fires when a spin the item chose lands |
loading | false | boolean | the team is loading: the button waits and the line says so |
sound | off | true or 0–1 | a soft tick a flip and a chime on the landing, only after a press |
labels | see below | strings | title ("Who’s buying coffee?"), spin, again ("Spin again"), retry, picked ("{name}’s round."), picking, failed, empty, loading |
className | — | — | added to the root |
Sound
None. It loads in silence.
Off unless you pass sound (true, or a volume 0–1). After a press: a soft key tick on each flip, slightly lower as it slows, saved when it lands, failed if the pick fails. Never on hover, on mount, or when a new pick spins it. 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.
Who's buying coffee? Photo flaps spin through the team and land on someone.
For random picks, raffles and team drawsMore in People & nearby