The agent asks one short question when a request matches more than one thing, two customers called Northgate or three open contracts, and you pick the one you meant: cards with a detail line, number keys, a Something else field, then it locks on the pick and says what was picked.
On this page
- Agent asks which one
- Disambiguate a name
- Pick a contract or file
- Short pick in a chat turn
Examples
Installation
npx knowns-ui@latest add clarify-choicePaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Clarify choice from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/clarify-choice
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add clarify-choice
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/kbd.tsx
- components/ui/knowns/clarify-choice/clarify-choice.tsx
- components/ui/knowns/clarify-choice/clarify-choice-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/clarify-choice, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "clarify-choice" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.Props
- question
ReactNode- The agent's question, one sentence. It names the radio group.
- options
ClarifyOption[]- id, label, detail, meta, icon, disabled. Two to six read best; the first nine get a number key.
- value / defaultValue
string|null- Default
null - The pick, controlled or not. Once set the cards lock.
- onChoose
(id, option) => void- Called once with the pick. Continue the run from here.
- onChange
() => void- Shows Change after the pick. Clear value to ask again.
- other
{ label?, placeholder?, onSubmit }- A Something else field for an answer outside the list.
- pickedLabel
(option) => ReactNode- Default
"You picked {label}." - The line under the cards after the pick, read out politely.
- shortcuts
boolean- Default
true - Number keys 1 to 9 and their hints on the cards (hints only with a fine pointer).
- columns
1|2- Default
2 - Two cards per row from 480px of container width.
- disabled, className
-- Locks every card / on the card.
| Prop | Type | Default | Description |
|---|---|---|---|
| question | ReactNode | - | The agent's question, one sentence. It names the radio group. |
| options | ClarifyOption[] | - | id, label, detail, meta, icon, disabled. Two to six read best; the first nine get a number key. |
| value / defaultValue | string | null | null | The pick, controlled or not. Once set the cards lock. |
| onChoose | (id, option) => void | - | Called once with the pick. Continue the run from here. |
| onChange | () => void | - | Shows Change after the pick. Clear value to ask again. |
| other | { label?, placeholder?, onSubmit } | - | A Something else field for an answer outside the list. |
| pickedLabel | (option) => ReactNode | "You picked {label}." | The line under the cards after the pick, read out politely. |
| shortcuts | boolean | true | Number keys 1 to 9 and their hints on the cards (hints only with a fine pointer). |
| columns | 1 | 2 | 2 | Two cards per row from 480px of container width. |
| disabled, className | - | - | Locks every card / on the card. |
One column
Accessibility
- The cards are a radio group named by the question, with one tab stop. Arrows move between them, by row in two columns; Enter or Space picks.
- Number keys pick directly while focus is in the group. The key hints are hidden from screen readers and on touch screens.
- After the pick the cards are disabled, the pick keeps its check and a polite live line names it.
- Something else opens a labelled field; Escape closes it.
What it handles
- 01Asks one question over two to six cards, each with an icon, a label, a muted detail line and a value on the right.
- 02Puts the cards in two columns from 480px of container width, one below.
- 03Moves with the arrows as one radio group, picks with Enter, Space or the number keys 1 to 9.
- 04Locks on the pick: it keeps a ring and a check, the rest fade, and a line names it, with Change when you allow it.
- 05Adds a Something else field for an answer outside the list.
- 06Calls onChoose with the pick and never runs the agent itself; controlled or not.
States
- First render
- The cards at rest; nothing moves
- none
- Hover
- The card's background tints
- 120ms, ease out
- Pick
- The other cards fade and the pick gets its ring
- 120ms, ease out
- Reduced motion
- The change is instant
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | The cards at rest; nothing moves | none |
| Hover | The card's background tints | 120ms, ease out |
| Pick | The other cards fade and the pick gets its ring | 120ms, ease out |
| Reduced motion | The change is instant | 0ms |
Works with
When to use
When to use
- An agent asking which one you meant when a request matches two customers, three contracts or several files, before it goes on.
- A short pick inside a chat turn, with number keys and an answer outside the list.
When not to use
- Approving a tool call the agent wants to run: use Approval Prompt.
- Suggested follow-up questions after an answer: use AI Answer.
Using with AI
Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:
- Add the Knowns UI Clarify Choice to my app and wire it to my own data.
- I need an agent asking which one you meant when a request matches two customers, three contracts or several files, before it goes on. Set that up with the Knowns UI Clarify Choice.
- Which Clarify Choice props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "clarify-choice" }) and search_docs({ query: "clarify choice" }).