Components

Searchable Single Select

Searchable single selects let the user filter a list of options by typing and pick one. Use them when the list is long enough to benefit from search.

Stable
GitHub

Anatomy

Anatomy
import {SearchableSingleSelect} from '@staffbase/spark';

<SearchableSingleSelect.Root>
  <SearchableSingleSelect.Input />
  <SearchableSingleSelect.Popup>
    <SearchableSingleSelect.Empty />
    <SearchableSingleSelect.Status />
    <SearchableSingleSelect.List>
      <SearchableSingleSelect.Group>
        <SearchableSingleSelect.GroupLabel />
        <SearchableSingleSelect.Collection>
          <SearchableSingleSelect.Item />
        </SearchableSingleSelect.Collection>
      </SearchableSingleSelect.Group>
      <SearchableSingleSelect.Separator />
      <SearchableSingleSelect.Item />
    </SearchableSingleSelect.List>
  </SearchableSingleSelect.Popup>
</SearchableSingleSelect.Root>;

Examples

Grouped

Pick one fruit or vegetable.

API reference

Root

Inherits props fromBase UI Combobox Root

Manages the combobox’s open state, selected value, and available items.

Input

Inherits props fromBase UI Combobox Input

The text field that filters the list and displays the selected value.

NameTypeDescription
placeholder
string
Hint text shown while the field is empty.
leadingIcon
ReactNode
An icon rendered at the start of the field.
Inherits props fromBase UI Combobox Positioner
NameTypeDescription
container
HTMLElementRefObject<HTMLElement>
The element the popup portal renders into. Use this instead of z-index to control stacking. Defaults to the document body.

Empty

Inherits props fromBase UI Combobox Empty

Rendered inside the popup when no items match the current query.

List

Inherits props fromBase UI Combobox List

Renders the list of items, or of groups when the options are grouped.

Item

Inherits props fromBase UI Combobox Item

Group

Inherits props fromBase UI Combobox Group

Wraps a labelled section of items inside the list.

GroupLabel

Inherits props fromBase UI Combobox GroupLabel

Collection

Inherits props fromBase UI Combobox Collection

Renders an Item for each item within a Group.

Separator

Inherits props fromBase UI Combobox Separator

Visually separates groups of items in the list.

Status

Inherits props fromBase UI Combobox Status

Announces result counts and loading state to assistive technology.