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
GitHubAnatomy
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
Input
Inherits props fromBase UI Combobox Input
| Name | Type | Description |
|---|---|---|
placeholder | string | Hint text shown while the field is empty. |
leadingIcon | ReactNode | An icon rendered at the start of the field. |
Popup
Inherits props fromBase UI Combobox Positioner
| Name | Type | Description |
|---|---|---|
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
List
Inherits props fromBase UI Combobox List
Item
Inherits props fromBase UI Combobox Item
Group
Inherits props fromBase UI Combobox Group
GroupLabel
Inherits props fromBase UI Combobox GroupLabel
Collection
Inherits props fromBase UI Combobox Collection
Separator
Inherits props fromBase UI Combobox Separator
Status
Inherits props fromBase UI Combobox Status
When to use
When not to use
How to use
Structure
Leading icon
Do
A group icon that names the type of content being selected.
Don't
A decorative icon that says nothing about the options.
Placeholder
Options list
Pick one fruit or vegetable.
Selected value and search
Long labels truncate in the field and in the list.
Validation
Select an audience to continue.
Accessibility
Content and UX copy
Do
Short, Title Case option labels and a placeholder that shows an example.
Don't
Sentence-long, lowercase labels and a placeholder that repeats the label.