A property as a small pill that opens a searchable picker: status, priority, assignee, labels or a date. One choice or many, create from the search, and quick picks for dates, all from the keyboard.
Used for
- Issue properties
- Row quick edits
- Popover forms
- Due dates
- Labels
Examples
Size
Dates
Installation
npx knowns-ui@latest add pill-pickerFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Pill Picker 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/pill-picker
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 pill-picker
```
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
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/calendar/calendar.tsx
- components/ui/knowns/calendar/calendar-utils.ts
- components/ui/knowns/calendar/calendar-zone.ts
- components/ui/knowns/use-floating.ts
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/avatar.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/dialog.tsx
- components/ui/knowns/kbd.tsx
- components/ui/knowns/field-class.ts
- components/ui/knowns/textarea.tsx
- components/ui/knowns/chat-composer/use-autosize.ts
- components/ui/knowns/input.tsx
- components/ui/knowns/menu.tsx
- components/ui/knowns/tag.tsx
- components/ui/knowns/combobox.tsx
- components/ui/knowns/popover.tsx
- components/ui/knowns/pill-picker.tsx
- components/ui/knowns/pill-picker-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/pill-picker, 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: "pill-picker" }) 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
- label
string- What the pill sets. The pill is named "<label>: <value>" and the search "Search <label>".
- kind
"options"|"date"- Default
"options" - A list of options, or a date with quick picks and a calendar.
- options
PillOption[]- { value, label, icon?, supportingText?, keywords?, disabled? }. The search matches label, supportingText and keywords.
- value / onChange
string[] or Date|null- The chosen values (one for a single choice), or the date.
- multiple
boolean- Default
false - The menu stays open and each pick toggles. The pill shows the first label and +N.
- onCreate
(text) => void- Offers Create for typed text that is not an option.
- icon
ReactNode- The pill's glyph while the choice has none of its own.
- emptyText
string- Default
label - What the pill says while nothing is chosen.
- size
"sm"|"md"- Default
"md" - 24 or 28px high.
- iconOnly
boolean- Default
false - Only the glyph while nothing is chosen, for a dense row.
- searchPlaceholder / noMatchText / loading
string / string / boolean- The search field's text, the empty list's text, and a loading line.
- presets / min / max / now
{ label, date }[] / Date- Dates: the quick picks (default Today, Tomorrow, Next week, In two weeks), the range, and today.
- lateIsWarning
boolean- Default
false - Dates: a past day reads red.
- open / onOpenChange / align / disabled
boolean / (open) => void- Control the menu, where it lines up, and turn the pill off.
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | - | What the pill sets. The pill is named "<label>: <value>" and the search "Search <label>". |
| kind | "options" | "date" | "options" | A list of options, or a date with quick picks and a calendar. |
| options | PillOption[] | - | { value, label, icon?, supportingText?, keywords?, disabled? }. The search matches label, supportingText and keywords. |
| value / onChange | string[] or Date | null | - | The chosen values (one for a single choice), or the date. |
| multiple | boolean | false | The menu stays open and each pick toggles. The pill shows the first label and +N. |
| onCreate | (text) => void | - | Offers Create for typed text that is not an option. |
| icon | ReactNode | - | The pill's glyph while the choice has none of its own. |
| emptyText | string | label | What the pill says while nothing is chosen. |
| size | "sm" | "md" | "md" | 24 or 28px high. |
| iconOnly | boolean | false | Only the glyph while nothing is chosen, for a dense row. |
| searchPlaceholder / noMatchText / loading | string / string / boolean | - | The search field's text, the empty list's text, and a loading line. |
| presets / min / max / now | { label, date }[] / Date | - | Dates: the quick picks (default Today, Tomorrow, Next week, In two weeks), the range, and today. |
| lateIsWarning | boolean | false | Dates: a past day reads red. |
| open / onOpenChange / align / disabled | boolean / (open) => void | - | Control the menu, where it lines up, and turn the pill off. |
Accessibility
- The pill is a button named with the property and its value, with aria-expanded and the menu as a labelled dialog.
- The search is a combobox over a listbox; the highlighted option is aria-activedescendant, so focus never leaves the field. Chosen options are aria-selected.
- Escape and a pick give focus back to the pill. Escape closes only the picker inside a dialog or a popover.
- The date calendar has full keyboard support; the quick picks and Clear are buttons.
What it handles
- 01Shows a property as a small pill named for screen readers as the property and its value, such as Status: In progress.
- 02Opens a search right under the pill; the arrow keys, Home and End move while focus stays in the search, and Enter picks.
- 03Single choice closes on a pick; multiple choice stays open and each pick toggles, with the first label and +N on the pill.
- 04Offers Create for typed text that is not an option yet, for labels and tags.
- 05Dates: Today, Tomorrow, Next week and In two weeks above a calendar, Clear, and a past due date in red.
- 06Escape closes only the picker, so the dialog or popover form around it stays open.
States
- First render
- Nothing moves
- none
- Open and close
- The menu fades in under the pill and out again
- 120ms, ease out
- Hover on the pill
- The fill darkens a step
- 120ms, ease out
- Move in the list
- The highlight jumps to the row
- none
- Reduced motion
- The menu appears and goes at once
- 0ms
| State | What moves | Timing |
|---|---|---|
| First render | Nothing moves | none |
| Open and close | The menu fades in under the pill and out again | 120ms, ease out |
| Hover on the pill | The fill darkens a step | 120ms, ease out |
| Move in the list | The highlight jumps to the row | none |
| Reduced motion | The menu appears and goes at once | 0ms |
Works with
When to use
When to use
- A row of properties under a title: status, priority, assignee, labels and a due date, each a small pill that opens a search.
- Quick edits in a list row or a popover form, where a full select would be too heavy.
When not to use
- A labelled field in a settings form: use Combobox.
- Filters over a list, with counts: use Filter Chips.
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 Pill Picker to my app and wire it to my own data.
- I need a row of properties under a title: status, priority, assignee, labels and a due date, each a small pill that opens a search. Set that up with the Knowns UI Pill Picker.
- Which Pill Picker props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "pill-picker" }) and search_docs({ query: "pill picker" }).