Skip to content
Storybook

Combobox

Searchable select. Single: typing filters options. Multi: chosen values become removable Tags.

Preview

React · live from the Storybook

HTML and CSS

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

Usage

  • Use when there are many options and people know what they want.

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>

Examples

Single

data-px-combobox="single".

API reference

Class / attributeTypeDescription
data-px-combobox="single|multi"attributeMode (Figma Type).
input[role="combobox"]elementFilter input with aria-controls.
px-combobox__tagsclassHolds Tags and the input (multi).

Figma properties

Combobox16 variants · page “Dropdown”Open

Searchable select. Single: typing filters options; Multi: selected values become removable Tags inside the field. ARIA: role=combobox with aria-expanded and aria-activedescendant.

PropertyTypeValues
TypeVariantSingle Multi
StateVariantActive Open 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-tag-backgroundcolor-surface-default#ffffff
--px-tag-bordercolor-border-neutral-default#eaecf0
Show all 35 tokens
TokenAliasLight value
--px-tag-contentcolor-content-neutral-secondary#475467
--px-tag-iconcolor-content-neutral-placeholder#667085
--px-tag-radiusradius-sm4px
--px-tag-gapspacing-xs4px
--px-menu-backgroundcolor-surface-overlay#ffffff
--px-menu-bordercolor-border-neutral-subtle#f2f4f7
--px-menu-item-background-hovercolor-background-neutral-default#f2f4f7
--px-menu-item-background-selectedcolor-background-brand-subtle#eff6ff
--px-menu-item-content-selectedcolor-content-brand-default#2563eb
--px-menu-item-content-destructivecolor-content-danger-default#b42318
--px-menu-item-iconcolor-content-neutral-secondary#475467
--px-menu-sectioncolor-content-neutral-tertiary#667085
--px-menu-radiusradius-1212px
--px-menu-item-radiusradius-88px
--px-menu-paddingspacing-xs4px
--px-menu-item-padding-xspacing-1212px
--px-menu-item-gapspacing-sm8px
--px-menu-item-height-smcontrol-height-sm32px
--px-menu-item-height-mdcontrol-height-md40px
--px-menu-width240px240px
--px-input-focus-halo#2563eb2e#2563eb2e

Accessibility

  • role=combobox with aria-expanded and aria-activedescendant.
  • Backspace in an empty multi field removes the last tag.