People loupe Pro
One payment, every Pro piece. $9 tomorrow.
Install
npx shadcn@latest add @mu-pro/people-loupePro. Installs with your licence key through the @mu-pro registry; the key comes with Pro. Lands in components/mu/people-loupe/ with the shared foundation.
Usage
import { PeopleLoupe } from "@/components/mu/people-loupe/PeopleLoupe";
<PeopleLoupe people={team} onPick={(p) => router.push(`/people/${p.id}`)} />
<PeopleLoupe layout="row" people={viewers} />Use with an agent Beta
npx shadcn@latest add @mu-pro/uisdk/people-loupeOptional. 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: in the grid, rest the mouse on the crowd for a moment and the loupe follows it, naming the face under it; leave and it glides back to the match it was on. Click a face to pick it. In the row the loupe follows the pointer exactly and names each face; click to pick.
- Touch: the loupe goes to your finger at once, with no wait, and follows it along the row; a tap picks.
- Keyboard: the grid is one field: type to search, Up and Down step the loupe between matches (between everyone when nothing is typed), Enter picks, Escape clears. The row is one stop: arrows step face to face, Home and End jump to the ends, Enter or Space picks. The field is a combobox and the crowd a listbox holding only the faces the search found (everyone while nothing is typed; the others stay in the picture but leave the accessibility tree, and with no match the combobox is collapsed). The line under the crowd is a polite status, so a screen reader hears how many were found ("5 found for de"), the person under the loupe, and "No one called…". Two items on one page are two listboxes: name each with
labels.list. - Reduced motion: the loupe jumps instead of gliding, on the same visits, so it rests where it would have; it appears without growing, and the words arrive without rising.
Props
| Prop | Default | What it does |
|---|---|---|
people | — | { id, name, photo, tags? }[] | the crowd, in order; photo is a square face crop, drawn round; tags are teams or roles the search also reads |
layout | "grid" | "grid", "row" | the search grid, or the avatar row |
query / defaultQuery / onQueryChange | "" | any string | what is typed in the field (grid only) |
match | word start | (person, query) => boolean | your own test; the default matches the start of any word of the name or a tag, so "des" finds "Design" and "ch" finds "Maya Chen" |
active / defaultActive / onActiveChange | first match | a person's id, or null | the person under the loupe; set it to send the loupe there |
onPick | — | (person) => unknown | a click, a tap, or Enter on a person |
loading | false | boolean | people are on their way: the grid shows empty seats and says so |
labels | English | PeopleLoupeLabels | search, placeholder, count ("{n} of {of}"), none ("No one called {q}"), found ("{n} found for {q}", read out, not shown), empty, loading, hint, list |
name | — | string | the field's form name, so a <form> posts the query |
sound | off | true or 0–1 | a soft detent on each arrow step and on a pick |
className | — | — | added to the root |
Sound
None. It loads in silence.
Off unless you pass sound (true, or a volume 0–1). A soft detent plays on each arrow step, and a slightly brighter one on a pick (a click, a tap or Enter); never on hover, while the loupe tours, on mount or from a prop change. 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.
A glass loupe over a crowd of faces: type to search and it glides to each match, bringing it into focus.
For team directories and people searchMore in People & nearby