BetaPublic beta — Read the release notes
Documentation

Select

Dropdown selection from a list of options.

Package
@solidiom/select
Version
0.0.1-next.0
Status
stable

Preview

This preview uses documentation-only styling. Ship with one of the included recipe outputs (CSS, Tailwind, or UnoCSS) for production styles.

Dropdown selection from a list of options.

Usage

Compose Root, Trigger, Content, Item, Value, HiddenInput, ScrollUpButton, ScrollDownButton.

import * as Select from "@solidiom/select"

;<Select.Root>Select content</Select.Root>

Installation

Install the package with pnpm add @solidiom/select. The package requires compatible solid-js and @solidjs/web peer dependencies.

Parts

Select exposes 8 parts:

  • Rootdata-part="root".
  • Triggerdata-part="trigger".
  • Contentdata-part="content".
  • Itemdata-part="item".
  • Valuedata-part="value".
  • HiddenInputdata-part="hiddeninput".
  • ScrollUpButtondata-part="scrollupbutton".
  • ScrollDownButtondata-part="scrolldownbutton".

Styling

Select carries data-scope="select" and data-part attributes on each part for CSS/recipe targeting. State attributes like data-state, data-disabled, and data-highlighted are exposed where applicable.

Keyboard & behavior

KeyBehavior
ArrowDownOpens the listbox if closed; moves highlight to the next option.
ArrowUpMoves highlight to the previous option.
EnterSelects the highlighted option and closes the listbox.
EscapeCloses the listbox without changing the selection.
SpaceOpens the listbox or selects the highlighted option.

Composition

Select is designed to compose with other primitives. Its parts can be combined with Field, Button, or other primitives as needed.

SSR and hydration

Select renders as semantic HTML during server rendering. Interactive behavior (keyboard handlers, state management) activates on hydration without layout shift.