{"name":"search","title":"Search","description":"","kind":"component","category":"navigation","status":"beta","props":{"items":{"type":"array","items":{"value":"string","label":"string","group":"string? (rows with the same group are listed together under it)","icon":"icon? (React an element, Vue / Svelte a component)","meta":"string?","shortcut":"string[]? (keys, as Kbd takes them)","keywords":"string[]? (more words the query matches)","disabled":"boolean?"},"description":"Commands in order. Strings are accepted as value = label. A query matches the label or any keyword, anywhere in the word, ignoring case; matches are listed best first (the label starts with the query, then a word of it does, then the label holds it, then a keyword), ties in their own order, each group under its label in the order its best match comes."},"query":{"type":"string","default":"","model":true,"description":"The text in the field."},"limit":{"type":"number","default":5,"description":"Rows shown while the query is empty. A non-empty query shows every match."},"placeholder":{"type":"string","default":"Search…"},"label":{"type":"string","default":"Search","attr":"aria-label","part":"input","description":"Accessible name of the field."},"clearLabel":{"type":"string","default":"Clear search","attr":"aria-label","part":"clear"},"emptyTitle":{"type":"string","default":"No results found"},"emptyHint":{"type":"string","default":"Adjust your search to try again"},"highlightFirst":{"type":"boolean","default":false,"description":"The first row starts highlighted, so Enter runs it at once (a command palette). Without it nothing is highlighted until a key or the pointer moves the highlight, or a query highlights its first match."}},"playground":{"name":"Playground","props":{"items":[{"value":"project:web-app","label":"web-app","meta":"Project"},{"value":"person:priya","label":"Priya Raman","meta":"Member"},{"value":"action:new-project","label":"Create a project","meta":"Action"},{"value":"project:billing-api","label":"billing-api","meta":"Project"},{"value":"person:daniel","label":"Daniel Okafor","meta":"Member"},{"value":"action:invite","label":"Invite teammates","meta":"Action"}],"limit":3,"placeholder":"Search projects, people and actions…","label":"Search Northwind"},"width":320},"exampleFiles":[{"file":"workspace","title":"Search the workspace"},{"file":"grouped-commands","title":"Commands in groups, with shortcuts"},{"file":"run-an-action","title":"Run an action, one not allowed"},{"file":"no-results","title":"Nothing matches"}],"worstCase":[{"name":"Long labels and many rows","props":{"query":"a","label":"Search","placeholder":"Search every customer, plan, invoice and renewal schedule in the workspace…","items":[{"value":"long","label":"Reconcile the Q4 wholesale invoice batch for Aleksandra Wiśniewska-Kowalczyk’s Northwind Industries Holdings account","meta":"Finance"},{"value":"email","label":"bartholomew.fitzgerald@northwind-industries-holdings.example.com","meta":"⌘⇧K"},{"value":"one","label":"A"},{"value":"rtl","label":"مراجعة تكاليف الحوسبة لهذا الأسبوع","meta":"RTL"},{"value":"cjk","label":"第4四半期の需要予測を更新する"},{"value":"emoji","label":"🚀 Launch 🎉 & rollout — release batch 12,480"},{"value":"row-1","label":"Archive supplier record 01 — Aurora Analytics"},{"value":"row-2","label":"Archive supplier record 02 — Aurora Analytics"},{"value":"row-3","label":"Archive supplier record 03 — Aurora Analytics"},{"value":"row-4","label":"Archive supplier record 04 — Aurora Analytics"},{"value":"row-5","label":"Archive supplier record 05 — Aurora Analytics"},{"value":"row-6","label":"Archive supplier record 06 — Aurora Analytics"},{"value":"row-7","label":"Archive supplier record 07 — Aurora Analytics"},{"value":"row-8","label":"Archive supplier record 08 — Aurora Analytics"},{"value":"row-9","label":"Archive supplier record 09 — Aurora Analytics"},{"value":"row-10","label":"Archive supplier record 10 — Aurora Analytics"},{"value":"row-11","label":"Archive supplier record 11 — Aurora Analytics"},{"value":"row-12","label":"Archive supplier record 12 — Aurora Analytics"},{"value":"row-13","label":"Archive supplier record 13 — Aurora Analytics"},{"value":"row-14","label":"Archive supplier record 14 — Aurora Analytics"},{"value":"row-15","label":"Archive supplier record 15 — Aurora Analytics"},{"value":"row-16","label":"Archive supplier record 16 — Aurora Analytics"},{"value":"row-17","label":"Archive supplier record 17 — Aurora Analytics"},{"value":"row-18","label":"Archive supplier record 18 — Aurora Analytics"},{"value":"row-19","label":"Archive supplier record 19 — Aurora Analytics"},{"value":"row-20","label":"Archive supplier record 20 — Aurora Analytics"},{"value":"row-21","label":"Archive supplier record 21 — Aurora Analytics"},{"value":"row-22","label":"Archive supplier record 22 — Aurora Analytics"},{"value":"row-23","label":"Archive supplier record 23 — Aurora Analytics"},{"value":"row-24","label":"Archive supplier record 24 — Aurora Analytics"},{"value":"row-25","label":"Archive supplier record 25 — Aurora Analytics"},{"value":"row-26","label":"Archive supplier record 26 — Aurora Analytics"},{"value":"row-27","label":"Archive supplier record 27 — Aurora Analytics"},{"value":"row-28","label":"Archive supplier record 28 — Aurora Analytics"},{"value":"row-29","label":"Archive supplier record 29 — Aurora Analytics"},{"value":"row-30","label":"Archive supplier record 30 — Aurora Analytics"},{"value":"row-31","label":"Archive supplier record 31 — Aurora Analytics"},{"value":"row-32","label":"Archive supplier record 32 — Aurora Analytics"},{"value":"row-33","label":"Archive supplier record 33 — Aurora Analytics"},{"value":"row-34","label":"Archive supplier record 34 — Aurora Analytics"},{"value":"row-35","label":"Archive supplier record 35 — Aurora Analytics"},{"value":"row-36","label":"Archive supplier record 36 — Aurora Analytics"},{"value":"row-37","label":"Archive supplier record 37 — Aurora Analytics"},{"value":"row-38","label":"Archive supplier record 38 — Aurora Analytics"},{"value":"row-39","label":"Archive supplier record 39 — Aurora Analytics"},{"value":"row-40","label":"Archive supplier record 40 — Aurora Analytics"},{"value":"row-41","label":"Archive supplier record 41 — Aurora Analytics"},{"value":"row-42","label":"Archive supplier record 42 — Aurora Analytics"},{"value":"row-43","label":"Archive supplier record 43 — Aurora Analytics"},{"value":"row-44","label":"Archive supplier record 44 — Aurora Analytics"},{"value":"row-45","label":"Archive supplier record 45 — Aurora Analytics"},{"value":"row-46","label":"Archive supplier record 46 — Aurora Analytics"},{"value":"row-47","label":"Archive supplier record 47 — Aurora Analytics"},{"value":"row-48","label":"Archive supplier record 48 — Aurora Analytics"},{"value":"row-49","label":"Archive supplier record 49 — Aurora Analytics"},{"value":"row-50","label":"Archive supplier record 50 — Aurora Analytics"},{"value":"row-51","label":"Archive supplier record 51 — Aurora Analytics"},{"value":"row-52","label":"Archive supplier record 52 — Aurora Analytics"},{"value":"row-53","label":"Archive supplier record 53 — Aurora Analytics"},{"value":"row-54","label":"Archive supplier record 54 — Aurora Analytics"}]}},{"name":"No results","props":{"query":"brown butter bourbon brittle crunch","items":[{"value":"forecast","label":"Forecast Q4 demand"},{"value":"suppliers","label":"Find contract renewals"},{"value":"compare","label":"Compare plan tiers"},{"value":"launch","label":"Draft pricing launch plan"},{"value":"connectors","label":"Check connector status"},{"value":"sugar","label":"Audit compute costs"},{"value":"retire","label":"Retire unused seats"}],"emptyTitle":"No results found for “brown butter bourbon brittle crunch”","emptyHint":"Adjust your search to try again, or check the spelling of the plan, customer or invoice number"}},{"name":"One row","props":{"items":[{"value":"only","label":"Jo"}]}},{"name":"Zero rows","props":{"items":[]}},{"name":"Long group labels and shortcuts","props":{"label":"Search commands","items":[{"value":"a","label":"Rotate the production API key and notify every webhook subscriber","group":"Security and access for the Northwind workspace and its 1,284 members","shortcut":["Ctrl","Shift","Alt","K"],"meta":"billing-api"},{"value":"b","label":"A","group":"B","shortcut":["⌘","1"]},{"value":"c","label":"تبديل المظهر","group":"التفضيلات","shortcut":["⌘","T"]}]}}],"anatomy":[{"part":"root","element":"div"},{"part":"panel","element":"div","description":"Raised card holding the field and the results"},{"part":"bar","element":"div","description":"Field row (the combobox control). Focus changes nothing on it: no ring, the rule stays line; the caret is the focus indicator. The clear button and the results keep the standard :focus-visible ring."},{"part":"icon","element":"span","description":"Magnifier; decorative, never intercepts the pointer"},{"part":"input","element":"input","description":"role=combobox; fills the row; aria-activedescendant follows the highlight"},{"part":"clear","element":"button","description":"The real Button, marked data-search=\"clear\" (ghost, xs, square, muted) with an x icon, the aria-label and our tooltip carrying the same text. Shown while the query is non-empty (hidden attribute otherwise); not a tab stop, Escape does the same"},{"part":"list","element":"div","description":"role=listbox; scrolls past 8 rows; hidden while the empty state shows"},{"part":"highlight","element":"span","description":"Shared gliding highlight layer (`glideLayer` of `lib/glide.ts`); it glides for arrow-key moves too"},{"part":"group","element":"div","optional":true,"repeat":true,"description":"role=group around the rows of one group (items with the same `group`), in the order the groups first appear; rows without a group are listed with no group around them. Labelled by its group label (aria-labelledby). The highlight glides between neighbouring rows and moves at once across a group label."},{"part":"group-label","element":"div","optional":true,"repeat":true,"description":"The group's name: the shared option row's group label (2xs/500 ink-2); never highlighted, never chosen"},{"part":"item","element":"div","repeat":true,"description":"role=option; data-highlighted, data-disabled. Only matching rows are in the DOM; composes the shared option row (`lib/option.ts`: 30px, text.dense (12.5px), gap 8)"},{"part":"item-icon","element":"span","optional":true,"description":"Leading icon (14px, ink-3), decorative (aria-hidden)"},{"part":"item-text","element":"span","description":"Truncates at the end; the shared option row's text (`lib/option.ts`)"},{"part":"item-meta","element":"span","optional":true,"description":"Trailing muted note (a path, a category); the shared option row's meta (`lib/option.ts`)"},{"part":"item-shortcut","element":"kbd","optional":true,"description":"The command's own shortcut at the end of the row: the real Kbd (boxed), marked data-search=\"item-shortcut\". It shows the shortcut that runs the command outside the search; inside it Enter runs it."},{"part":"empty","element":"div","description":"The system's empty-state (size block, centred) marked data-search=\"empty\": icon, title, hint. Shown when a non-empty query matches nothing (hidden attribute otherwise)"}],"events":{"queryChange":"(query: string)","select":"(value: string, item) when an option is chosen with Enter or a click; the field takes the option's label"},"states":["bar-hover","focus-within","highlighted","item-press","item-disabled","clear-hover","clear-press","empty","grouped"],"tokens":["color.surface","color.line","color.hover","color.ink","color.ink-2","color.ink-3","shadow.raised","radius.card","text.sm","duration.fast","duration.base","text.2xs"],"a11y":{"role":"combobox + listbox","keyboard":["Typing filters the list; the first match is highlighted","ArrowDown / ArrowUp move the highlight in the order the rows are drawn (groups included; wraps); Home / End jump to the first and last option","Enter selects the highlighted option; the field takes its label","Escape clears the query and the selection","Focus never leaves the field: options are reached through aria-activedescendant, and the clear button is not a tab stop"],"notes":["The field carries the accessible name (label); the list is announced as a listbox whose result count is reported by the engine's live region.","The highlight glides for arrow-key moves as well as under the pointer; focus never leaves the field.","On coarse pointers the field is 16px so iOS does not zoom the page, and rows are 40px tall.","A group is role=group named by its label; the label is never an option. An item's shortcut is read with the option (it names the key that runs the command elsewhere)."]},"motion":["highlight: glides between neighbouring options over duration.move, under the pointer and the keyboard; across a group label it moves at once (it never sweeps over the label)","rows: no entrance animation, the list changes on every keystroke","empty state: the empty-state's own opacity fade over duration.base when it appears","clear button: fades in when it appears after mount (the button's opacity transition, armed by ready); a search mounted with a query shows it at once; press is the button's (scale to motion.press-scale over duration.press)","bar: background over duration.fast"]}