Skip to content

Select

Dropdown picker with search, multi-select, virtualization-ready items, and full keyboard nav.

Forms & Inputs·Available inReactVueAngular·View as Markdown

Preview

tsx

Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.

Installation

Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.

$ pnpm add @sisyphos-ui/react

Then import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";

Usage

Idiomatic usage in each supported framework
import { useState } from "react";
import { Select } from "@sisyphos-ui/react";

export const Country = () => {
  const [value, setValue] = useState<string | number | null>("tr");
  return (
    <Select
      label="Country"
      value={value}
      onChange={setValue}
      searchable
      clearable
      options={[
        { value: "tr", label: "Türkiye" },
        { value: "us", label: "United States" },
      ]}
    />
  );
};

Multi select

Add `multiple` to allow multiple values; `value` becomes an array.

tsx

Searchable & clearable

`searchable` adds an input filter; `clearable` shows a clear button.

tsx

Clear button

Clearable for quick reset — keeps existing keyboard ergonomics.

tsx

Error state

Surface validation with `error` + `errorMessage`.

tsx
Please pick a framework to continue.

Infinite scroll

`loading`, `hasMore`, and `onLoadMore` enable server-driven pagination. Works with `searchable`.

tsx

API

PropTypeDefaultDescription
options*SelectOption[]Options to render (`value`, `label`, optional `description`, `icon`, `disabled`).
valueSelectValue | null | SelectValue[]Selected value (controlled): single value or `null`, an array when `multiple`.
onChange(value: SelectValue | null | SelectValue[]) => voidCalled with the next selection; receives an array when `multiple`.
multiplebooleanfalseMulti-select mode — selected values render as removable tags.
placeholderstring"Select…"Text shown while nothing is selected.
searchablebooleanfalseAdds a search input inside the dropdown; filters client-side unless `onSearch` is set.
clearablebooleanfalseShows a clear button when a value is selected.
creatablebooleanfalseAllow typing arbitrary new values with Enter (multi mode only).
loadingbooleanfalseShows a loading row at the bottom of the list.
onLoadMore() => voidFired when the listbox scrolls near the bottom; gate with `hasMore` for infinite scroll.
errorbooleanfalseMarks the field as invalid for styling and ARIA.
errorMessageReactNodeMessage shown below the field when `error` is true (replaces `helperText`).

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.

Accessibility

Adheres to the Combobox WAI-ARIA design pattern.

  • The trigger exposes role="combobox" with aria-expanded, aria-haspopup="listbox", and aria-controls pointing at the open list.
  • The dropdown is a role="listbox" (aria-multiselectable in multi mode); each option has role="option" with aria-selected and aria-disabled.
  • aria-invalid and aria-disabled on the trigger mirror error / disabled; the error message is announced with role="alert".
  • Clear and tag-remove buttons carry descriptive aria-labels ("Clear selection", "Remove <label>").
  • When searchable, focus moves into the search input as the dropdown opens.

Keyboard interactions

KeyAction
EnterOpens the dropdown when closed; selects the active option when open (or creates the typed value in creatable multi mode).
SpaceOpens the dropdown when closed.
ArrowDownOpens the dropdown, or moves the active option down.
ArrowUpMoves the active option up.
HomeMoves to the first option.
EndMoves to the last option.
EscapeCloses the dropdown.
Need more?View on npm →
Was this page helpful?