Skip to content
Knowns UI
Get ProSign in

Pill Picker

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.

On this page
Used for
  • Issue properties
  • Row quick edits
  • Popover forms
  • Due dates
  • Labels

Examples

Size

Dates

Installation

npx knowns-ui@latest add pill-picker
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

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
Defaultfalse
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
Defaultlabel
What the pill says while nothing is chosen.
size
"sm" | "md"
Default"md"
24 or 28px high.
iconOnly
boolean
Defaultfalse
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
Defaultfalse
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

  1. 01Shows a property as a small pill named for screen readers as the property and its value, such as Status: In progress.
  2. 02Opens a search right under the pill; the arrow keys, Home and End move while focus stays in the search, and Enter picks.
  3. 03Single choice closes on a pick; multiple choice stays open and each pick toggles, with the first label and +N on the pill.
  4. 04Offers Create for typed text that is not an option yet, for labels and tags.
  5. 05Dates: Today, Tomorrow, Next week and In two weeks above a calendar, Clear, and a past due date in red.
  6. 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

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" }).

Need help?

Stuck on Pill Picker, or found something off? We read every message.