Discovery field Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/discovery-fieldPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/discovery-field/ with the shared foundation.
Usage
import { DiscoveryField } from "@/components/mu/discovery-field/DiscoveryField";
<DiscoveryField items={peers} scanning={open} onPick={send} action={<button onClick={sendAll}>Share with all</button>} />
<DiscoveryField size="md" items={peers} scanning={open} onPick={send} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/discovery-fieldOptional. 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 a face to pick it; press it again to let go. The strip's 36px faces reach 44px for a finger.
- Keyboard: each face is a button (Tab, then Enter or Space), named by its person or device, with
aria-pressedfor the pick; the count is a polite live region. - Reduced motion: no waves; you breathe slowly while it looks, and each face appears as soon as it is reported, its dots already gathered.
Props
| Prop | Default | What it does |
|---|---|---|
items | [] | NearbyItem[] | what your discovery has found so far: { id, name, distance?, kind?, photo?, bearing?, icon? }. Each waits until a wave reaches it, then the dots gather into its face. An empty list is the empty state |
scanning | true | boolean | a wave leaves you every 2.5s only while true; false lets the last waves fade over 1.2s, shows every item at once, and the field rests |
size | "lg" | lg, md | lg a 300px field with names and the count; md an 80px strip with 36px faces in one row on its centre line, and no count row (the count is still read aloud; the quiet note sits in the strip) |
range | 10 | metres | the distance at the field's edge: an item sits distance / range of the way out |
selected / defaultSelected / onSelectedChange | null | an item's id or null | the chosen face, controlled; onSelectedChange(id, item) fires on every pick, and (null, null) when the chosen face is picked again |
onPick | — | (item) => void | fires with the item when a person picks a face, not when they let it go: send, pair, invite |
action | — | a node | your own control at the end of the count row, such as "Share with all" (lg only) |
emptyAfter | 6 | seconds | how long it looks with nothing found before it says "No one nearby yet" |
labels | see below | text | scanning "Looking nearby…", empty "No one nearby yet", unit "nearby" (after the count) |
className | — | — | added to the root |
Sound
None. It loads in silence.
None: a scan plays for its whole wait, so it stays silent.
Licence
Included with Pro: use it in unlimited end products for you and your clients; no reselling as a kit. See the licence.
A field of dots: waves roll out from you, and the dots gather into the people and devices found.
For finding nearby people and devicesMore in People & nearby