Skip to content
Storybook

Search

Search field with leading icon, clear button when filled and an optional keyboard shortcut hint.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Usage

  • Use role="search" on the form.
  • Show the shortcut only on desktop.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

API reference

Class / attributeTypeDescription
px-input__clearclassShown automatically when the field has text.
px-kbdclassKeyboard shortcut hint.

Figma properties

Search30 variants · page “Input Fields”Open

Search field with leading icon, clear button when filled and an optional keyboard shortcut hint. Use role=search on the surrounding form.

PropertyTypeValues
ShortcutBoolean—
SizeVariantSmall Medium Large
StateVariantActive Hover Focused Filled Disabled
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-input-content-placeholdercolor-content-neutral-placeholder#667085
--px-input-content-labelcolor-content-neutral-secondary#475467
--px-input-content-hintcolor-content-neutral-tertiary#667085
--px-input-content-errorcolor-content-danger-default#b42318
--px-input-radiusradius-1212px
--px-input-height-mdspacing-4040px
--px-input-padding-xspacing-1212px
--px-input-height-smspacing-3636px
--px-input-height-lgcontrol-height-lg48px
--px-input-gapspacing-88px
--px-input-field-gapspacing-88px
--px-input-width320px320px
--px-input-focus-halo#2563eb2e#2563eb2e

Accessibility

  • The clear button needs aria-label="Clear".