// preview in
saved for every page

Native select

The browser's own select, styled by the skin. Best for long, familiar lists and on phones, where it opens the system picker.

Built on HTMLPattern Native <select>Client componentSource ↗
minimal · light · #3fa34d
disabled

Installation

Set up Camaleo once (Installation), then import what you need.

import { NativeSelect, Label } from "@camaleo/react";

Anatomy

A wrapper around a real <select> and a chevron. The options are plain <option> and <optgroup> elements.

selectBrazilicon
[data-slot="native-select"][data-slot="native-select"] > select · [data-slot="icon"]<option> (children)

Examples

Every example is a real file you can copy. They all wear the skin, mode and brand from the bar above.

minimal · light · #3fa34d

Emails and invoices are sent in this language.

With a description

Inside a Field, FieldDescription is linked to the select, so it is read after the label.

Placeholder option

An empty, disabled first option plus required makes people choose, instead of keeping a guess you made for them.

Option groups

<optgroup> splits a long list into labeled sections, and screen readers announce the group name.

Long list

Eighty years fit fine: people type "19" to jump, and phones open their own scroll wheel.

One payment · total $1,200.00

Installments

Pick a number. A controlled value updates the summary, and aria-live reads the new amount.

Set by your billing country. Contact support to change it.

Disabled, with a reason

A disabled select can't be focused, so put the reason in visible text right next to it.

Choose how you want it shipped.

Required, with an error

Choose a method and the error goes away. Field invalid marks the select and links the FieldError to it.

Inline

In a toolbar, style={{ width: "auto" }} lets it hug its longest option next to its label.

In context

These are whole pieces of UI you can copy, in the skin you picked.

1–25 of 312

Table footerNativeSelect · Label · IconButton · Text
Filters
Filter panelFieldset · NativeSelect · Button

Delivery

DeliveryCard · Field · NativeSelect · Input · Button

Guidelines

DoLong lists people know.

Countries, states, years: people scan or type to find them.

Don’tA select for yes or no.

Two options hidden behind a click. Use a Switch, a Checkbox or a RadioGroup.

DoStart with a neutral option.

For answers that matter, "Choose a reason…" makes people pick one.

Don’tAn answer already picked.

People skip it, and you collect your own default as if it were their answer.

Props

NativeSelect takes every attribute of <select>. These are the ones you use most:

PropTypeDefaultDescription
autoCompletestring—Lets the browser fill it, e.g. "country" or "address-level1".
disabledboolean—Disables the select and removes it from the tab order.
namestring—Identifies the value when the form is submitted.
requiredboolean—The form won't submit while the selected option has an empty value.
valuestring—The selected option's value, controlled or not.
onChange(event: ChangeEvent<HTMLSelectElement>) => void—Runs when people pick another option. Read event.target.value.
defaultValuestring—The selected option's value, controlled or not.

className and style go to the wrapper <span>, so you can size it; every other attribute goes to the <select>.

Styling hooks

Restyle it without forking: target the attributes, or set the tokens on a parent, a skin or the select itself.

Attributes

data-slot"native-select" (the wrapper)
:disabledon the inner select when disabled
:focuson the inner select while focused
data-invalidon the inner select when its Field is invalid

Tokens it reads

Color

--cml-border-control--cml-danger--cml-fg--cml-field-bg--cml-field-border-sides--cml-field-shadow--cml-focus-ring

Shape & size

--cml-field-border-width--cml-field-height--cml-field-padding--cml-font-size-field--cml-radius-control--cml-radius-field

Type & motion

--cml-duration-fast--cml-ease-standard--cml-font-field

This component only

--cml-corner-shape--cml-disabled-opacity
/* a borderless select inside a table toolbar */
.toolbar [data-slot="native-select"] > select {
  --cml-border-control: transparent;
}

Accessibility

TabMoves focus to the select.
Arrow Up · Arrow DownChanges the selected option (opens the list on macOS).
Alt + Arrow DownOpens the list of options.
A–ZJumps to the next option that starts with the letter typed.
Was this page helpful? · Edit this page on GitHub