Skip to content
Components
/
Search
Dark

Search

Search lets people find content by typing a query, with voice input when the keyboard is in the way.

Preview

A search bar for the top of a screen or the first row of a list, with the microphone as an optional second way in. Type in it.

State follows what you type
48 tall, radius 18, padding 16, width fills the parent

Empty is State Default, anything typed is State Searched. CSS reads the field's content; no script decides. Three things move at once: the fill, the 1px edge, and soft token to strong. The trailing icon goes mic to x, and the x clears the field. The component fills its parent, so the 332 here comes from the variant frame. The bar stays on the two content states: Active is a caret state and a real input already draws its own caret.

States

Three variants. Empty is a filled pill with no edge, filled in is a white bar with one, and the third is the bar while a finger is in it.

State Default, Searched, Active, all at Style Field
bg/weak-50 no border, bg/white-0 with 1px, bg/white-0 with 1.5px brand
Search
Searched
Search

Default to Searched: the fill goes weak grey to white, a 1px border appears, and the icon and text step from the soft token to the strong one. The trailing icon changes job too, the microphone offers another way to start and the x clears what is there. Active is the third: the same white bar, but the edge is 1.5 and brand blue, and the text node is replaced by a Typed frame holding the query and a 2 by 22 caret two apart from it.

Style

The second axis. Field sits inline in a form or a header. Hero floats over a photographic header on a home screen, and ends in a real button rather than an icon.

Style Hero, all three states
345 x 60, radius 30, padding 18 and 8, gap 10, dropShadow/lg
Search
Searched
Search

Hero is 12 taller, 13 wider and carries a shadow, so it reads as an object sitting on the page rather than a row cut into it. The leading search icon drops 24 to 20, and the trailing 24 icon becomes a 44 icon-only Button on bg/strong-950 holding a 22 sliders-horizontal. Two things to know. Hero has no Show Mic, because it has no mic. And Hero's Searched changes only the text colour, where Field's Searched also changes the fill, the edge and the trailing icon, so the same state name means different things on the two styles.

Trailing icon

One boolean, wired to one variant. The 20 before it is a node in the file, not a gap.

Show Mic true and false, both at State Default, Style Field
the query row is the only thing that stretches
Search
Search
State Searched, where the boolean is not wired
the x is drawn whatever Show Mic says
Searched

Show Mic hides the microphone in the default state and nothing else. The searched variant carries no property reference, so the boolean does nothing there, and Hero has no mic at all. When the mic goes the query row takes the 24 back, but the empty 20 slot stays, so the text ends 20 short of the padding. That slot is an unfilled rectangle in the file. Hero solves the same problem a different way, with a flexible Spacer that exists only in its Active variant.

Properties

Two axes, one boolean and one text property. Six variants, and the boolean reaches exactly one of them.

Property
Type
Default
State
Default | Searched | Active
Default
Style
Field | Hero
Field
Placeholder
Text
Search
Show Mic
Boolean, bound to the mic in Default and Field only
True
Part
What it is
Size
Query row
Field only. Icon and text, the only child that stretches
fills, 256 at 332
Icon slot
Field only. An empty rectangle, no fill and no stroke
20 x 20
Typed
Active only. The query and a caret, 2 apart
hugs, caret 2 x 22
Spacer
Hero and Active only. An empty flexible frame
fills, 1 tall
Action
Hero only. An icon-only Button on bg/strong-950
44 x 44, icon 22
mic or x
Field only. Lucide at stroke 2, swapped by variant
24 x 24

Placeholder is a real text property, so the word in the bar is set on the instance rather than overridden on the layer. The entered value is not: the same text node carries both, at one style, 18/28 Semi Bold, heavier than most placeholders. There is still no loading or disabled state; add those yourself.

Tokens

Eight colours and one effect style, and several of the pairs are the same value under two names.

Token
Light
Dark
Applied to
bg/weak-50
#F4F5F5
#242427
The Field bar in Default
bg/white-0
#FFFFFF
#0E0E0F
Field in Searched and Active, and every Hero
border/soft-100
#E9E9EA
#2F2F31
The 1px inside edge, Field Searched and Hero
brand/base
#155DFC
#2B7FFF
The 1.5px Active edge and the caret
bg/strong-950
#0E0E0F
#FFFFFF
The Hero action button
fg/white-0
#FFFFFF
#0E0E0F
The sliders icon on that button
text/soft-500
#8E8E93
#AEAEB2
Placeholder and search icon, with fg/soft-500 on the mic
text/strong-950
#0E0E0F
#FFFFFF
Query text and icons once there is a query

The icons read fg/soft-500 and fg/strong-950; the text beside them reads text/soft-500 and text/strong-950. Each pair resolves to the same primitive in both modes, so the distinction is naming, not colour, and one CSS property covers both. bg/strong-950 and fg/white-0 are an inverting pair, which is why the Hero button is a black circle with a white icon in light and a white circle with a black icon in dark. The Hero shadow is the dropShadow/lg effect style, two drop shadows: 0 12 18 at spread -3 on black 8 percent, and 0 5 6 at spread -5 on black 5 percent.

Guidelines

Do
Search

Keep the placeholder to a word or two. The search icon and its gap take 32 before the text starts, and the slot and mic take another 44 after it.

Don't
Search products, brands and stores

Do not write a sentence in the field. At 18/28 Semi Bold it truncates in the middle of the promise and the half that survives is the half nobody needed.

Field goes in the Top Bar or at the head of a list, never floating in the middle of content. Hero is the one exception the file draws, and it is a narrow one: a home screen header, over an image, with the action button doing something real. Turn Show Mic off unless voice input actually works; an icon that opens nothing costs a target. Neither the x nor the action button is wired to anything, so clearing the field and handling the action are code you write.