SearchBar
When to use it
Section titled “When to use it”- Use type field to search within one list or page, such as “Search messages”, “Search reviews” or the back office “Search” in the header.
- Use size md (36px) on web and in the back office; use size lg (44px) in the mobile app for a bigger tap target.
- Use type stay at the top of the website and search results to find a stay by place, dates and guests.
- Say what is being searched in the placeholder: “Search messages”, not just “Search”, unless the page makes it obvious.
- Show the clear (×) button as soon as there is text, and keep the typed value after the results load.
- In type stay, always show a value in each part, such as the dates already chosen, never an empty slot.
When not to use it
Section titled “When not to use it”- To filter by fixed values such as status or property: use Chip filters or a Dropdown.
Instead: Chip, Dropdown - To type data into a form, such as a name or an address: use a text field.
Instead: text field - More than one type stay on the same page.
The Figma page names no alternative.
Built since the review. The second “when not to use it” item names text field as the alternative. At b9ffb76 a text field exists: Textfield is exported from the package root (src/index.ts:54) and defined in src/components/Form/Textfield.tsx, inside the folder of Form rather than a folder of its own. The release review’s finding below was written before it existed.
From the release review, under “Findings outside the gates”, as written:
Dead-end pointer in dont_use_when. text field is not a built component. Owner: designer / planning.
Best practice
Section titled “Best practice”From the Figma documentation page (usage node 214:29), as written. These items aren’t carried into SearchBar.intent.json, which has no field for them.
- Say what is being searched in the placeholder: “Search messages”, not just “Search”, unless the page makes it obvious.
- Show the clear (×) button as soon as there is text, and keep the typed value after the results load.
- In type stay, always show a value in each part, such as the dates already chosen, never an empty slot.
What each variant is for
Section titled “What each variant is for”| Property | Value | What it is for |
|---|---|---|
type |
field |
to search within one list or page, such as “Search messages”, “Search reviews” or the back office “Search” in the header. |
type |
stay |
at the top of the website and search results to find a stay by place, dates and guests. |
size |
md |
(36px) on web and in the back office. |
size |
lg |
(44px) in the mobile app for a bigger tap target. |
state |
empty |
Figma doesn’t say. |
state |
focused |
Figma doesn’t say. |
state |
filled |
Figma doesn’t say. |
No description for the three states. empty, focused, filled are empty strings in SearchBar.intent.json, shown above as “Figma doesn’t say.” Figma’s component description (node 213:54) only names them: “state empty (Placeholder), focused (blue border) or filled (Value, with a clear × button).” It gives no usage text for them.
From the release review, under “Findings outside the gates”, as written:
Empty state descriptions. variant_intent values for empty, focused, filled are empty strings: a recorded Figma gap, not sourced from anywhere. Owner: the designer.
Accessibility
Section titled “Accessibility”- The field type is a role=“search” landmark wrapping a native <input type=“search”>, so text entry and focus are the browser’s own.
src/components/SearchBar/SearchBar.tsx:137 - The input is named by the label prop, falling back to the placeholder (aria-label).
src/components/SearchBar/SearchBar.tsx:155 - The clear control is a native <button type=“button”> named “Clear search”; it shows only while the field has text, and focus returns to the input after clearing.
src/components/SearchBar/SearchBar.tsx:160 - Focus after clearing is returned to the input.
src/components/SearchBar/SearchBar.tsx:132 - The clear button shows a focus-visible outline in the focus border colour; the field border also turns to the focus colour while the input has focus (focus-within).
src/components/SearchBar/SearchBar.css:84 - The stay type is a role=“search” landmark named “Search stays” (aria-label).
src/components/SearchBar/SearchBar.tsx:93 - The search and clear icons and the stay dividers are hidden from assistive technology (aria-hidden).
src/components/SearchBar/SearchBar.tsx:48 - The stay Search control is the Button component, a native <button type=“button”>.
src/components/Button/Button.tsx:36
What this version promises
Section titled “What this version promises”From Versioning (VERSIONING.md at b9ffb76):
0.3.0 adds six components on top of 0.2.1: Calendar, Card, Form, Modal, SideBar and Table. It contains twenty-three components, each exported from the package root with its props type: Avatar, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Checkbox, Chip, Dropdown, File, Form, Header, Image, Link, Logo, Modal, ProgressBar, RadioCard, SearchBar, SideBar, Stepper, Table, Toggle. Textfield is exported from the package root as well, with TextfieldProps and TextfieldState, and is public like the others (see decisions.md, 2026-10-07, Textfield). It commits you to their props, prop values and defaults, their hz- class names, the tokens in tokens.css and the three entry points (., ./styles.css, ./tokens.css). Everything in 0.3.0 beyond 0.2.1 is an addition: nothing from 0.2.1 was changed, removed or renamed. A change that breaks any of these on 0.x bumps the version to 0.4.0.
Two things about this release are worth knowing:
- Form, Modal and Table each passed release review with their literal sizes covered by a ruling in decisions.md (Card, SideBar and Calendar have their own), because no size tokens exist for them. Those literals are accepted until the designer adds matching tokens, so a later change to use tokens at the same rendered sizes would be a patch, not a breaking change.
- Dark theme is not verified for Table, and its warning tag has low contrast. The Table docs page says so. Neither is a breaking-change risk, but a fix that changes a token’s value is a patch and is listed in the changelog.
Stories
Section titled “Stories”Back Office
Section titled “Back Office”Trips Web
Section titled “Trips Web”App Large
Section titled “App Large”All Variants
Section titled “All Variants”Interactive
Section titled “Interactive”Stay Interactive
Section titled “Stay Interactive”The single-variant stories (FieldMdEmpty, FieldMdFocused, FieldMdFilled, FieldLgEmpty, FieldLgFocused, FieldLgFilled, StayLgFilled) are cells of the variant matrix; the Design tab links each one.
Import
Section titled “Import”import { SearchBar } from "@layerbasesystemic/horizon-design-system";import type { SearchBarProps, SearchBarType, SearchBarSize, SearchBarState } from "@layerbasesystemic/horizon-design-system";@layerbasesystemic/horizon-design-system/tokens.css and @layerbasesystemic/horizon-design-system/styles.css must be loaded too; see Developing.
SearchBar.tsx is built from Button: it imports it (SearchBar.tsx:4) and renders <Button> (SearchBar.tsx:107). The registry’s Composes column for SearchBar lists Button.
| Prop | Type | Default | Description |
|---|---|---|---|
type |
SearchBarType |
"field" |
Figma type. field is the search input; stay is the website stay search. |
size |
SearchBarSize |
"md" |
Figma size (field only). md is 36px (web, back office); lg is 44px (mobile app). |
state |
SearchBarState |
— | Figma state (field only). Leave unset in real use: empty, filled and focused follow the text and keyboard focus. filled starts with the Figma value “Alfama” when no value is given; focused pins the blue focus border (as drawn in the Figma cell). |
placeholder |
string |
"Search messages" |
Field placeholder (Figma Placeholder). Say what is searched, e.g. “Search messages”. |
value |
string |
— | Field text (controlled). |
defaultValue |
string |
— | Field initial text when uncontrolled. |
onValueChange |
(value: string) => void |
— | — |
onSearch |
(value?: string) => void |
— | Field: Enter pressed. Stay: Search button pressed. |
onClear |
() => void |
— | Field: the clear (x) button pressed. |
label |
string |
— | Accessible name of the field. Defaults to the placeholder. |
name |
string |
— | Field name, so the text posts with a form. |
where |
string |
"Lisbon, Portugal" |
Stay values. |
checkIn |
string |
"14 Sep" |
— |
checkOut |
string |
"18 Sep" |
— |
guests |
string |
"2 guests, 1 room" |
— |
SearchBarProps also extends Omit<HTMLAttributes<HTMLDivElement>, "onChange" \| "defaultValue">, so native attributes pass through to the element (SearchBar.tsx:10).
Props that are not Figma properties. The stories’ header comment says: “Not Figma properties (added so the component is usable): defaultValue, onValueChange, onSearch, onClear, label, name. Figma draws no hover, pressed or disabled state.” (SearchBar.stories.tsx:10-11). They are declared at defaultValue, onValueChange, onSearch, onClear, label, name.
From the release review, under “Findings outside the gates”, as written:
Props that are not Figma properties. defaultValue, onValueChange, onSearch, onClear, label, name (SearchBar.tsx:26 to 35), plus passthrough div attributes. They become public API once published. Owner: a human, to accept or ask the designer to draw them.
How Figma’s state is read. state is a prop (SearchBarState: empty, focused, filled), but in the code it only sets a starting point: filled starts the text at the Figma value Alfama when neither value nor defaultValue is given (SearchBar.tsx:82), focused adds the hz-searchbar--focused class that pins the focus border as drawn in the Figma cell (SearchBar.tsx:142), and empty is what an empty field already is. Real focus does not come from state: the border follows border-color: var(--color-border-focus);, the :focus-within rule. The doc comment on state says: “Figma state (field only). Leave unset in real use: empty, filled and focused follow the text and keyboard focus. filled starts with the Figma value “Alfama” when no value is given; focused pins the blue focus border (as drawn in the Figma cell).” (SearchBar.tsx:21). For type="stay", the component returns at SearchBar.tsx:84 before it reads size or state, and sets hz-searchbar--lg itself (SearchBar.tsx:95), so those two props do nothing there.
The stay parts are not keyboard reachable. SearchBar.tsx renders Where, Check in, Check out and Guests as a <div> holding two <span>s each (SearchBar.tsx:98-105), with no tabIndex anywhere in the file; the only focusable element in type="stay" is the <Button> for Search (SearchBar.tsx:107).
From the release review, under “Findings outside the gates”, as written:
Stay parts are not keyboard reachable. Where, Check in, Check out and Guests render as static spans (SearchBar.tsx:98 to 105), as Figma draws them; only the Search button is focusable. QA recorded this as not failed by decision. Owner: the designer.
Union types
Section titled “Union types”SearchBarType: field, stay
SearchBarSize: md, lg
SearchBarState: empty, focused, filled
Tokens it needs
Section titled “Tokens it needs”Every CSS custom property SearchBar.css reads, with its value in the token build at b9ffb76.
| Token | Light | Dark |
|---|---|---|
--border-width-md |
2px |
same as light |
--border-width-sm |
1px |
same as light |
--color-bg-elevated |
#f9fafb |
#4d5361 |
--color-border-default |
#d7dee7 |
#4d5361 |
--color-border-focus |
#1d44ba |
#6692f8 |
--color-border-subtle |
#eef1f5 |
#272a37 |
--color-text-primary |
#161925 |
#f9fafb |
--color-text-secondary |
#4d5361 |
#9ca2b1 |
--fontfamily-body |
Inter |
same as light |
--fontsize-lg |
13px |
same as light |
--fontsize-sm |
11px |
same as light |
--fontsize-xl |
14px |
same as light |
--lineheight-lg |
20px |
same as light |
--lineheight-sm |
16px |
same as light |
--lineheight-xl |
20px |
same as light |
--radius-xs |
2px |
same as light |
--spacing-2xl |
24px |
same as light |
--spacing-lg |
16px |
same as light |
--spacing-md |
12px |
same as light |
--spacing-sm |
8px |
same as light |
--spacing-xl |
20px |
same as light |
--spacing-xs |
4px |
same as light |
This matches required_tokens in SearchBar.intent.json exactly.
Figma node
Section titled “Figma node”Page Searchbar (57:1645), documentation frame ❖ searchbar (214:7), component set searchbar (213:54). The file is shared with the team only, so the frame and the link ask anyone outside it to sign in.
Variant matrix
Section titled “Variant matrix”type (2) × size (2) × state (3) = 12 combinations, of which Figma publishes 7 cells. The component set (213:54) publishes 7 variants, not the 12 that type x size x state would give: type field has all six size x state cells (md and lg, each empty, focused and filled); type stay has one, size lg, state filled (960 wide). Placeholder, Value and the stay values Where, Check in, Check out and Guests are properties of the set, not cells; the specimen board (214:7) draws them as the instances Back office (214:14), Trips (web) (214:19) and App, lg (214:24). Figma draws no hover, pressed, disabled or error state.
| Figma variant | Figma node | Story |
|---|---|---|
type=field, size=md, state=empty |
213:2 |
FieldMdEmpty |
type=field, size=md, state=focused |
213:6 |
FieldMdFocused |
type=field, size=md, state=filled |
213:10 |
FieldMdFilled |
type=field, size=lg, state=empty |
213:16 |
FieldLgEmpty |
type=field, size=lg, state=focused |
213:20 |
FieldLgFocused |
type=field, size=lg, state=filled |
213:24 |
FieldLgFilled |
type=stay, size=lg, state=filled |
213:30 |
StayLgFilled |
Each row is the Storybook story for that Figma variant and its node. SearchBarType, SearchBarSize, SearchBarState are the union types listed on the Code tab; Figma’s type, size, state are props of the code, and the Code tab says how state is read. Figma publishes 7 of the 12 combinations; type=stay, size=md, state=empty, type=stay, size=md, state=focused, type=stay, size=md, state=filled, type=stay, size=lg, state=empty, type=stay, size=lg, state=focused are not published, so there is no cell or story for them. The stories that aren’t a single cell (BackOffice, TripsWeb, AppLarge, AllVariants, Interactive, StayInteractive) are embedded on the Examples tab.
Themes
Section titled “Themes”The searchbar component set renders every cell once, in one theme. It has no separate light and dark frames.
The token build defines 179 tokens for light and redeclares 50 for dark; the Code tab shows SearchBar’s tokens in both.
Values Figma never bound
Section titled “Values Figma never bound”Values on the Figma node that aren’t bound to a variable, and what SearchBar.css at b9ffb76 does with each.
| Layer | Property | Figma value | In the code |
|---|---|---|---|
| type=field, size=md (213:2, 213:6, 213:10) | vertical padding (the code computes it from –spacing-sm and –border-width-sm with calc(), not a px literal) | 8px |
padding-block: calc(var(--spacing-sm) - var(--border-width-sm)); |
| type=field, size=lg (213:16, 213:20, 213:24) | vertical padding (the code computes it from –spacing-md and –border-width-sm with calc(), not a px literal) | 12px |
padding-block: calc(var(--spacing-md) - var(--border-width-sm)); |
| Where, Check in, Check out, Guests, type=stay (213:31, 213:35, 213:39, 213:43) | gap between label and value (the code computes it from –spacing-xs with calc(), not a px literal) | 2px |
gap: calc(var(--spacing-xs) / 2); |
| Divider, type=stay (213:34, 213:38, 213:42) | height (the code computes it from –spacing-2xl and –spacing-sm with calc(), not a px literal) | 32px |
height: calc(var(--spacing-2xl) + var(--spacing-sm)); |
| Divider, type=stay (213:34, 213:38, 213:42) | fill (bound in Figma to the variable color/border/subtle, which is not named like a –color-… token; the code reads –color-border-subtle) | #eef1f5 |
background: var(--color-border-subtle); |
| Button, type=stay (213:46) | width (the code computes it from –spacing-xl with calc(), not a px literal) | 80px |
width: calc(var(--spacing-xl) * 4); |
| Search icon and Clear, type=field (14px) | width and height | 14px |
Not in the stylesheet: set as width=“14” height=“14” attributes on the <svg> elements (SearchBar.tsx lines 48 and 56): src/components/SearchBar/SearchBar.tsx |
Figma variables against the token build
Section titled “Figma variables against the token build”| Figma variable | Figma value | Token in the build | Built light value | Agrees |
|---|---|---|---|---|
--color-text-secondary |
#4d5361 |
--color-text-secondary |
#4d5361 |
yes |
--fontSize-lg |
13 |
--fontsize-lg |
13px |
yes |
--fontWeight-regular |
Regular |
no such token | — | no token |
--fontFamily-body |
Inter |
--fontfamily-body |
Inter |
yes |
--lineHeight-lg |
20 |
--lineheight-lg |
20px |
yes |
--spacing-sm |
8 |
--spacing-sm |
8px |
yes |
--spacing-md |
12 |
--spacing-md |
12px |
yes |
--radius-xs |
2 |
--radius-xs |
2px |
yes |
--border-width-sm |
1 |
--border-width-sm |
1px |
yes |
--color-bg-elevated |
#f9fafb |
--color-bg-elevated |
#f9fafb |
yes |
--color-border-default |
#d7dee7 |
--color-border-default |
#d7dee7 |
yes |
--color-border-focus |
#1d44ba |
--color-border-focus |
#1d44ba |
yes |
--color-text-primary |
#161925 |
--color-text-primary |
#161925 |
yes |
--fontSize-xl |
14 |
--fontsize-xl |
14px |
yes |
--lineHeight-xl |
20 |
--lineheight-xl |
20px |
yes |
--fontSize-sm |
11 |
--fontsize-sm |
11px |
yes |
--fontWeight-medium |
Medium |
no such token | — | no token |
--lineHeight-sm |
16 |
--lineheight-sm |
16px |
yes |
--color-text-inverse |
#f9fafb |
--color-text-inverse |
#f9fafb |
yes |
--fontSize-xs |
10 |
--fontsize-xs |
10px |
yes |
--lineHeight-xs |
16 |
--lineheight-xs |
16px |
yes |
--radius-sm |
6 |
--radius-sm |
6px |
yes |
--color-primary-default |
#3b71f2 |
--color-primary-default |
#2b5ad6 |
no |
--spacing-lg |
16 |
--spacing-lg |
16px |
yes |
--fontWeight-regular, --fontWeight-medium are bound in Figma but the token build has no token of that name.
--color-primary-default holds a different value in Figma from the token of the same name in the build. SearchBar.css doesn’t read that token, but the stylesheet of the component SearchBar is built from does (Button.css), so the Button rendered inside SearchBar uses the build’s value, not Figma’s.
Design gaps recorded against it
Section titled “Design gaps recorded against it”The registry link is the canvas. The Figma cell for SearchBar on the board holds the canvas page (node 57:1645, Searchbar), not the component set (213:54). The page header’s Figma link goes to that canvas and says so; the frame above is the documentation frame 214:7.
From the release review, under “Findings outside the gates”, as written:
Registry link. The Figma cell holds the canvas page (node-id=57-1645), not the component set 213:54. Owner: the cell’s owner.
The icon size is an attribute, not a token. The search icon and the clear icon each carry width="14" height="14" on the <svg> (SearchBar.tsx:48, SearchBar.tsx:56), and SearchBar.css sets no width or height on .hz-searchbar__icon. From the release review, under “SVG icon attributes (width=“14” height=“14”)“, as written:
SearchBar.tsx line 48 (search icon) and line 56 (clear icon) both carry width=“14” height=“14” viewBox=“0 0 14 14” as attributes on the <svg>, not in the stylesheet.
Does gate 2 cover them? My reading, unchanged from the first review: no. The gate’s “how to answer” says “read every declaration in the component’s stylesheet”. Gate 2 as written covers stylesheets only. These are markup attributes with unitless numbers (SVG user units), and SearchBar.css has no width or height on .hz-searchbar__icon. The gate’s one-line question could be read more widely. If a human intends it to reach markup attributes, these are a finding with no covering ruling (decisions.md has no SearchBar ruling; the Button ruling covers Button.css only). A ruling would have to name width=“14” and height=“14” on SearchBar.tsx:48 and :56, accepted because they are the Figma icon size and no icon size token exists (the spacing scale has 12 and 16px, not 14px). I did not write it. The Cleared verdict rests on the stylesheet-only reading; if the human reads gate 2 more widely, this verdict must be revisited.
Every commit to src/components/SearchBar up to b9ffb76, newest first, with the published version that carries it.
| Commit | Date | Version | Change |
|---|---|---|---|
14dbdc8 |
2026-10-04 | 0.2.0 | SearchBar intent: add state keys empty, focused, filled to variant_intent |
d12d57a |
2026-10-04 | 0.2.0 | SearchBar: intent file from Figma 214:29, code and stories |
96ecae0 |
2026-10-04 | 0.2.0 | SearchBar: build from Figma 213:54 (field md/lg, stay) |