Skip to content
coatx
Esc
↑↓navigate↵open⌘Jpreview
On this page

Native Select

Styled native HTML select element with coarse-pointer sizing and custom chevron slot.

▾
▾

Usage

import {
  nativeSelect,
  nativeSelectIcon,
  nativeSelectWrapper,
} from "coatx/native-select";

export const RuntimeSelect = () => (
  <div {...nativeSelectWrapper()}>
    <select aria-label="Runtime" {...nativeSelect()}>
      <option value="bun">Bun</option>
      <option value="node">Node.js</option>
      <option value="deno">Deno</option>
    </select>
    <span {...nativeSelectIcon()}>▾</span>
  </div>
);

Exports (coatx/native-select)

Export Description
nativeSelectWrapper(options?) Relative wrapper positioning the trailing chevron icon
nativeSelect(options?) Styled <select> (size: "default", "sm"; invalid, disabled)
nativeSelectIcon(options?) Non-interactive trailing chevron indicator
nativeSelectStyles Compiled StyleX style map

Was this page helpful?