Components/Form

Search

Search is the field a reader types a question into. What goes in is a query the page is expected to answer rather than a value it will keep, so the words the reader chooses are what narrow the results they get back. The prompt inside it is what says how far that reach goes.

import { Search } from '@growth-protocol-ai/alpha';

On this page

size
rounding
state
Search.tsxtsx
1import { Search } from '@growth-protocol-ai/alpha';
2
3<>
4 <label htmlFor="playground-search">Search the library</label>
5 <Search
6 size="regular"
7 rounding="default"
8 disabled={false}
9 readOnly={false}
10 clearable
11 id="playground-search"
12 label="Library search"
13 placeholder="Search portfolios, stories, reports…"
14 />
15</>

When to use

Reach for Search wherever a surface holds more than a reader can scan — a table, a library, a directory — and let the prompt name what it reaches, because a reader who cannot tell how far the field looks will not trust an empty result. Decide early whether results arrive as the reader types or only when they ask for them; that choice is the one the rest of the surface has to be built around.

When not to use

Do not reach for Search to collect something the reader is contributing — a name, an address, a title — however alike the two look on a page. That is a text input, and the test is what happens on Enter: a search hands the page a query and expects an answer back, while a text input holds a value until the form around it is submitted. A field that drops a panel of live suggestions is a combobox, and is not this component either.

size2 values

Size is geometry only — it never changes what the field means. Both heights are the button’s, the dropdown’s and the text field’s, so a toolbar that mixes them lines up row by row.

regular
large
sizeWhen to use
regular36px. Toolbars, filter bars and page headers.
large52px. Search-led heroes and touch-first surfaces.

rounding2 values

The one shape choice the text field does not offer, and it is a claim about the surface around the control rather than about the control: the states, the border, the glass and the clear × are identical either way. The pill is for a search that owns its row; anywhere it sits among other controls — a dropdown, a filter, a row of toolbar actions — stay square.

default
pill
roundingWhen to use
default--radius-md, 12px. The field shape shared with the button, the dropdown and the text input. Reach for it whenever the search sits among other controls.
pill--radius-full. For a search that owns its visual context — a search-led hero, a dashboard’s primary search, a command palette. Beside rectangular siblings the rounded ends read as a chip rather than a field.