Select

Single selects get a chevron drawn from --icon-chevron. Multiple and sized selects keep the native list, with no icon.

ClassDoes what
selectFull-width select with a chevron
select-errorError color, for when aria-invalid is not available

Basic

<label class="label">
  Environment
  <select class="select">
    <option>Development</option>
    <option>Staging</option>
    <option>Production</option>
  </select>
</label>

Multiple

<select class="select" multiple size="3">
  <option>One</option>
  <option>Two</option>
  <option>Three</option>
</select>

With Kobalte

alpha The class names and states here are stable. The look is not: these styles can change in a minor release, without a major version bump.

The native <select> above is settled. What follows is not: the listbox styling and .menu-selected are new.

Kobalte's Select is a button plus a listbox, not a native <select>. The Kobalte layer gives the trigger the field styling above, and the listbox the dropdown panel, so the same theme covers both.

<select class="select">
  <option>Development</option>
  <option>Production</option>
</select>

Leave out Select.Icon: the field draws its own chevron, the same one the native select gets.

Disabled

<select class="select" disabled>
  <option>Production</option>
</select>

The trigger is a form field, so it carries the same bottom margin as an .input. That margin is overridden in this demo because the listbox sits inline here; in an app the content is portaled and positioned by Kobalte's popper, which sets the gap with its gutter prop.

data-selected marks the chosen option and data-highlighted the one under the pointer or caret, so they get different treatments: .menu-selected and .menu-active.