Sonar scanner Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/sonar-scannerPro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/sonar-scanner/ with the shared foundation.
Usage
import { SonarScanner } from "@/components/mu/sonar-scanner/SonarScanner";
<SonarScanner items={found} scanning={scanning} onSelectedChange={(id, item) => wave(item)} />
<button><SonarScanner size="sm" scanning={scanning} /> Scanning</button>Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/sonar-scannerOptional. 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 row to pick that person or device; press it again to let go. The faces on the scope are its picture, not buttons.
- Keyboard: each row is a button (Tab, then Enter or Space), with
aria-pressedfor the pick; the status line is a polite live region, so "3 found nearby" is heard as it changes. - Reduced motion: the beam holds still and breathes its light slowly while scanning; each item appears as soon as it is reported, with no ping; the list and the words are the same.
Props
| Prop | Default | What it does |
|---|---|---|
items | [] | NearbyItem[] | what your discovery has found so far: { id, name, distance?, kind?, photo?, bearing? }. Each waits until the beam passes its bearing, then surfaces with one ping and joins the list. An empty list is the empty state |
scanning | true | boolean | the beam turns only while true; false coasts it to a stop in 1.2s and shows every item at once |
size | "lg" | lg, sm | lg the 220px scope with its status and list; sm a 20px scope alone in the text's colour |
range | 10 | metres | the distance at the rim: an item's radius is its distance over this (0.3–0.88 of the scope) |
selected / defaultSelected / onSelectedChange | null | an item's id or null | the chosen row, controlled; onSelectedChange(id, item) fires on every pick, and (null, null) when the chosen row is picked again |
emptyAfter | 6 | seconds | how long it scans with nothing found before it says "No one nearby yet" |
labels | see below | templates | scanning "Scanning…", empty "No one nearby yet", found "{count} found nearby", away "{distance} m away", action "Select", picked "Selected", hint (none), more "+{count} more" |
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 scan that finds people and devices nearby: a sweep of light turns, and each one surfaces with a ping as it is found.
For nearby sharing and device pairingMore in People & nearby