Xzero UI
Pro library

Select

A compact choice field with a keyboard friendly menu.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/select
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/select

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Select } from "@/components/xzero/select/select";

export function RegionSelect() {
  const [region, setRegion] = useState("eu");
  return (
    <Select
      label="Region"
      value={region}
      onValueChange={setRegion}
      options={[
        { value: "us", label: "United States" },
        { value: "eu", label: "Europe" },
        { value: "ap", label: "Asia Pacific", disabled: true },
      ]}
    />
  );
}

API reference

Select

A labelled Radix select whose shown value rolls in the direction of the list.

PropTypeDefaultDescription
label (required)string–Visible label for the trigger.
options (required){ value: string; label: string; disabled?: boolean }[]–Items in list order.
placeholderstring"Select an option"Shown when no value is selected.
descriptionstring–Helper copy under the trigger, linked through aria-describedby.
idstring–Trigger id. Generated when omitted.
classNamestring–Added to the trigger.
...propsOmit<SelectPrimitive.SelectProps, "children">–Radix Select root props: value, defaultValue, onValueChange, open, onOpenChange, name, required, disabled. ref goes to the trigger button.

Keyboard interactions

KeysAction
Enter / Space / ArrowDownOpens the list from the trigger.
ArrowUp / ArrowDownMoves between enabled items.
Enter / SpaceSelects the highlighted item and closes.
EscapeCloses without changing the value.
Type a letterJumps to the next item starting with it (Radix typeahead).

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in selects

Guidance for AI tools

Select: A compact choice field with a keyboard friendly menu. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components