A dropdown for picking one option from a short list
Space or ↓ opens · type a name to jump · M is you · Esc closes
pnpm dlx shadcn@latest add https://notchset.dev/r/select.jsonPick one of a short, known list.
Every shadcn style · one file
Import it and pass your content. The props that matter most are listed next.
"use client";
import * as React from "react";
import { Avatar } from "@/components/ui/notchset/avatar";
import { Select, type SelectOption } from "@/components/ui/notchset/select";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
/*
* Assign to: hands one job to a person or an agent. The list opens down in two groups, People (their photos) and
* Agents (each its orb, tinted by its name as everywhere else); the active row says one quiet thing in the list's
* foot. M picks you from anywhere in the open list. A new pick hops into the field. The closed select stands alone,
* centred on the stage (PIECES row 24, S1); the open list overhangs downward and the stage keeps it inside (system-stage
* measures its reach). On arrival it opens once, hands
* the job to Scout and rests closed.
*/
type Who = { value: string; name: string; src?: string; agent?: boolean; me?: boolean; foot: string };
const WORDS = {
label: "Assign to",
you: "you",
people: "People",
agents: "Agents",
cast: [
{ value: "maya", name: "Maya Lindqvist", src: "https://notchset.dev/media/people/person-03.webp", me: true, foot: "4 open · in the office today" },
{ value: "priya", name: "Priya Raman", src: "https://notchset.dev/media/people/person-01.webp", foot: "3 open · back Monday" },
{ value: "ines", name: "Ines Duarte", src: "https://notchset.dev/media/people/person-07.webp", foot: "1 open · free this afternoon" },
{ value: "ana", name: "Ana Ruiz", src: "https://notchset.dev/media/people/person-05.webp", foot: "6 open · with Dropbox until 3pm" },
{ value: "scout", name: "Scout", agent: true, foot: "Usually done in ~2m · asks before sending" },
{ value: "ledger", name: "Ledger", agent: true, foot: "Usually done in ~1m · never moves money alone" },
] as Who[],
};
const BEATS = [400, 900, 600];
export default function SelectDemo() {
const words = WORDS;
const less = useLessMotion();
const root = React.useRef<HTMLDivElement>(null);
const [value, setValue] = React.useState(words.cast[1]?.value ?? "");
const agent = words.cast.find((w) => w.agent);
const play = useSelfPlay(root, { beats: BEATS, off: less });
const [open, setOpen] = React.useState(false);
/* the arrival: the list opens, the job goes to the agent, the list closes; with less motion every step at once, so it rests on the pick */
React.useEffect(() => {
if (play.mine || play.step < 0 || !agent) return;
// eslint-disable-next-line react-hooks/set-state-in-effect -- each step of the arrival lands on its beat, as a hand's would
if (play.step === 0) setOpen(true);
if (play.step === 2) {
setValue(agent.value);
setOpen(false);
}
}, [play.step, play.mine, agent]);
const options: SelectOption<string>[] = words.cast.map((w) => ({
value: w.value,
label: w.name,
group: w.agent ? words.agents : words.people,
icon: w.agent ? <Avatar variant="agent" name={w.name} size="xs" /> : <Avatar name={w.name} src={w.src} size="xs" />,
meta: w.me ? words.you : undefined,
shortcut: w.me ? w.name.charAt(0).toLowerCase() : undefined,
foot: w.foot,
}));
return (
/* the field's box alone: the closed select is what is centred */
<div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} data-slot="select-room" className="w-[300px] max-w-full">
<Select label={words.label} options={options} value={value} onValueChange={setValue} open={open} onOpenChange={setOpen} />
</div>
);
}"use client";
import * as React from "react";
import { Avatar } from "@/components/ui/notchset/avatar";
import { Select, type SelectOption } from "@/components/ui/notchset/select";
import { useLessMotion } from "@/lib/notchset/motion";
import { useSelfPlay } from "./self-play";
/*
* Assign to: hands one job to a person or an agent. The list opens down in two groups, People (their photos) and
* Agents (each its orb, tinted by its name as everywhere else); the active row says one quiet thing in the list's
* foot. M picks you from anywhere in the open list. A new pick hops into the field. The closed select stands alone,
* centred on the stage (PIECES row 24, S1); the open list overhangs downward and the stage keeps it inside (system-stage
* measures its reach). On arrival it opens once, hands
* the job to Scout and rests closed.
*/
type Who = { value: string; name: string; src?: string; agent?: boolean; me?: boolean; foot: string };
const WORDS = {
label: "Assign to",
you: "you",
people: "People",
agents: "Agents",
cast: [
{ value: "maya", name: "Maya Lindqvist", src: "https://notchset.dev/media/people/person-03.webp", me: true, foot: "4 open · in the office today" },
{ value: "priya", name: "Priya Raman", src: "https://notchset.dev/media/people/person-01.webp", foot: "3 open · back Monday" },
{ value: "ines", name: "Ines Duarte", src: "https://notchset.dev/media/people/person-07.webp", foot: "1 open · free this afternoon" },
{ value: "ana", name: "Ana Ruiz", src: "https://notchset.dev/media/people/person-05.webp", foot: "6 open · with Dropbox until 3pm" },
{ value: "scout", name: "Scout", agent: true, foot: "Usually done in ~2m · asks before sending" },
{ value: "ledger", name: "Ledger", agent: true, foot: "Usually done in ~1m · never moves money alone" },
] as Who[],
};
const BEATS = [400, 900, 600];
export default function SelectDemo() {
const words = WORDS;
const less = useLessMotion();
const root = React.useRef<HTMLDivElement>(null);
const [value, setValue] = React.useState(words.cast[1]?.value ?? "");
const agent = words.cast.find((w) => w.agent);
const play = useSelfPlay(root, { beats: BEATS, off: less });
const [open, setOpen] = React.useState(false);
/* the arrival: the list opens, the job goes to the agent, the list closes; with less motion every step at once, so it rests on the pick */
React.useEffect(() => {
if (play.mine || play.step < 0 || !agent) return;
// eslint-disable-next-line react-hooks/set-state-in-effect -- each step of the arrival lands on its beat, as a hand's would
if (play.step === 0) setOpen(true);
if (play.step === 2) {
setValue(agent.value);
setOpen(false);
}
}, [play.step, play.mine, agent]);
const options: SelectOption<string>[] = words.cast.map((w) => ({
value: w.value,
label: w.name,
group: w.agent ? words.agents : words.people,
icon: w.agent ? <Avatar variant="agent" name={w.name} size="xs" /> : <Avatar name={w.name} src={w.src} size="xs" />,
meta: w.me ? words.you : undefined,
shortcut: w.me ? w.name.charAt(0).toLowerCase() : undefined,
foot: w.foot,
}));
return (
/* the field's box alone: the closed select is what is centred */
<div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} data-slot="select-room" className="w-[300px] max-w-full">
<Select label={words.label} options={options} value={value} onValueChange={setValue} open={open} onOpenChange={setOpen} />
</div>
);
}"use client";
import * as React from "react";
/*
* A demo that plays itself until the first touch: the script lives in the demo, never in the piece, which only gets
* the props a person would give it. It moves 0.4 s after the piece is first seen, then takes each step on its beat;
* off screen or paused it waits. The first press, key or focus on the piece (bind `handOver` to it; a scroll over it never counts) makes it the
* visitor's for good and drops every queued step; with less motion (`off`) it never plays and rests in its first frame.
* A host can hand it over from outside the piece too (a settings panel beside it the visitor has used): under
* <HandedOver value>, it never plays, a remount included.
*
* const play = useSelfPlay(root, { beats: [2800, 2800], loop: true, off: less });
* <div ref={root} onPointerDownCapture={play.handOver} onKeyDownCapture={play.handOver} onFocusCapture={play.handOver}>
* play.step // the step it is at, -1 before its first
* play.control // "pause" while it plays, "play" once paused (a new take), "replay" once it is over or yours
*
* Each step presses the piece's own controls (pressIn), so the script shows exactly what a hand can do.
*
* A host that shows the piece once (<PlayOnce value={{ settle }}>) changes three things: the script starts when the
* piece is first half in view and never again on coming back, it never loops, and with less motion (or `settle`) it
* takes every step at once, so the piece rests on the END of its moment. `hold` is a reason not to play at all that is
* not motion (a mode with nothing to show): it holds in every host. Under <PlayOnce value={{ active: false }}> (a look
* that is mounted but not shown) it waits until it is shown.
*/
type SelfPlayOptions = {
/** how long each step waits after the one before it, in ms; the first step waits 0.4 s after the piece is seen */
beats: readonly number[];
/** starts over after the last step; without it the script plays once and rests */
loop?: boolean | undefined;
/** no self-play at all (less motion): the piece is the visitor's from the start */
off: boolean;
/** no self-play for a reason other than motion (a mode with nothing to show), in every host */
hold?: boolean | undefined;
};
/** How a host shows the piece: once on arrival (see useSelfPlay). */
type PlayOnceHost = {
/** rest on the end at once, without playing (less motion, or a reset) */
settle?: boolean | undefined;
/** false while the piece is mounted but not shown: it waits */
active?: boolean | undefined;
};
const START = 400;
/**
* Whether a demo plays itself at all. Off: every piece rests in its first frame and is
* the visitor's from the start; nothing presses its controls for them.
*/
const SELF_PLAY: boolean = false;
/** True where the visitor has already taken the piece from outside it: nothing under it plays itself. */
const HandedOver = React.createContext(false);
/** A host that shows the piece once: play once on arrival, rest on the end (null: play as the demo asks). */
const PlayOnce = React.createContext<PlayOnceHost | null>(null);
function useSelfPlay(root: React.RefObject<Element | null>, { beats, loop: looped = false, off: still, hold = false }: SelfPlayOptions) {
const once = React.useContext(PlayOnce);
const active = once?.active !== false;
/* shown once: less motion (or a settled host) takes every step at once and rests on the end */
const quick = once != null && (still || Boolean(once.settle));
const loop = once == null && looped;
/* the first touch hands it over for good */
const [mine, setMine] = React.useState(false);
const handOver = React.useCallback(() => setMine(true), []);
const handedOver = React.useContext(HandedOver);
const off = !SELF_PLAY || hold || (quick ? false : still) || mine || (handedOver && !quick);
const [seen, setSeen] = React.useState(false);
const [paused, setPaused] = React.useState(false);
const [taken, setTaken] = React.useState(0);
const n = Math.max(1, beats.length);
const done = !loop && taken >= n;
React.useEffect(() => {
const el = root.current;
if (!active) return;
/* without an observer (an old browser, a test) it counts as seen */
if (!el || typeof IntersectionObserver === "undefined" || quick) {
const t = window.setTimeout(() => setSeen(true));
return () => window.clearTimeout(t);
}
/* shown once: first half in view starts it, and leaving never stops or restarts it */
const io = once
? new IntersectionObserver((es) => {
if (es.some((e) => e.isIntersecting && e.intersectionRatio >= 0.5)) {
setSeen(true);
io.disconnect();
}
}, { threshold: 0.5 })
: new IntersectionObserver((es) => setSeen(es.some((e) => e.isIntersecting)));
io.observe(el);
return () => io.disconnect();
}, [root, active, once, quick]);
const playing = !off && seen && active && !paused && !done;
const delay = quick ? 0 : taken === 0 ? START : (beats[taken % n] ?? START);
React.useEffect(() => {
if (!playing) return;
const t = window.setTimeout(() => setTaken((k) => k + 1), delay);
return () => window.clearTimeout(t);
}, [playing, taken, delay]);
/* one control in one place: Pause while it plays, Play (a new take) once paused, Replay once it is over or yours */
/* self-play off: never "over", so a demo rests in its FIRST frame, not its end frame */
const control: "pause" | "play" | "replay" = paused || !SELF_PLAY ? "play" : off || done ? "replay" : "pause";
return { step: taken === 0 ? -1 : (taken - 1) % n, taken, playing, control, mine, handOver, pause: () => setPaused(true) };
}
/**
* Presses a real control inside `root`, as the visitor would: the first match of `selector`, or the one whose text is
* `text`. A click only, so it never counts as the visitor's touch.
*/
function pressIn(root: Element | null, selector: string, text?: string) {
const all = [...(root?.querySelectorAll<HTMLElement>(selector) ?? [])];
(text == null ? all[0] : all.find((el) => el.textContent?.trim() === text))?.click();
}
export { HandedOver, PlayOnce, pressIn, useSelfPlay, type PlayOnceHost, type SelfPlayOptions };This example also uses Avatar. This command installs them with it, so the example pastes as it is:
pnpm dlx shadcn@latest add https://notchset.dev/r/select.json https://notchset.dev/r/avatar.jsoncomponents/ui/notchset/select.tsx
LevelMolecule: made of atoms only.
Free, no account or key. One command for every shadcn style. With the @notchset registry added, @notchset/<name> works too.
Works with React 18.3 or 19 on Tailwind CSS v4, in any shadcn project. What's tested
pnpm add @base-ui/react@^1 lucide-react@^1The CLI adds the styles to the CSS file named in components.json (tailwind.css). Check that it points at your global stylesheet, that the project uses Tailwind CSS v4, and that the file is imported in your root layout. Installed by hand: paste styles.css into that file.
The sound you hear is this page's: the piece you install plays none, and calls onFeedback on each move so you can add your own.
options–
SelectOption<V>[]Required.
value–
V | null | V[]the choice (controlled, with onValueChange); null for none yet
defaultValue–
V | null | V[]the choice at first (uncontrolled)
onValueChange–
(value: V) => void | (value: V[]) => voidplaceholder–
stringlabel–
React.ReactNodethe field's label above it (kind field)
hint–
React.ReactNodea quieter line under it
error–
React.ReactNodewhat is wrong, under it in the bad colour; marks it invalid
reason–
stringwhy it can't change, with `disabled`: read in the hint's place
labels–
Partial<SelectLabels>its built-in words, English by default
kind–
"field" | "property"aria-label–
stringFor a select with no visible label (a property row's term labels it visually: pass the same words).
aria-labelledby–
stringdisabled–
booleancan't change; give `reason` to say why
name–
stringthe form field name: a form sends the chosen value
open–
booleanthe list is open, when the host holds it (with onOpenChange)
defaultOpen–
booleanthe list is open on first render, then opens and closes on its own
onOpenChange–
(open: boolean) => voidcalled with the next open state: a pick, Escape or a click outside closes it
multiple–
false | trueone value (the default); pass true on a MultiSelect's props to pick several
onFeedback–
(e: FeedbackEvent) => voidcalled once per move, for your sound or haptics
clearLabel–
stringthe Clear button's name beside the trigger; it takes every pick off
Three usesa list's sort order · a person's time zone · a teammate's role
Give your coding assistant the Markdown guide instead of screenshots.
https://notchset.dev/api/mcp (setup)v1.2.0 · 2026-11-17
Ships field-parts.tsx (clearOfKeyboard, fieldSurface, useFocusRefused), which it now uses. Internal files split; installs smaller; no change to the piece's own API.
v1.1.0 · 2026-11-17
New props: clearLabel, multiple, onFeedback. Ships feedback.ts (FeedbackEvent, FeedbackProps), which it now uses. Ships key-cap-parts.tsx (KEY_CAP_LABELS, KeyCaps, asCtrl, capsOf, hintProps, isApple, keyCap, keyCapTone, KeyCapLabels, KeyCapsProps, Shortcut), which it now uses. Ships motion.ts (EASE, lessMotion, roleTiming, useLessMotion), which it now uses. Ships portal.ts (useStagePlacement), which it now uses. select.tsx now exports MultiSelectProps.
v1.0.0 · 2026-11-09
Released free with the Notchset system.