# Native Select (Lumen Halo): prompt.md (v1.0.0)

- id: `lumen-native-select` · version 1.0.0 · component · free
- category: Selection
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add https://beautiful-ui.dev/r/lumen-native-select.json`
- npm dependencies: none
- registry dependencies: utils, https://beautiful-ui.dev/r/lumen-foundation.json
- docs: https://beautiful-ui.dev/components/lumen-native-select
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

The browser's own picker (the best one on phones) in Lumen's recessed well, with the focus filament and a quiet chevron. shadcn's Native Select, cut from Lumen glass.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/lumen/native-select.tsx`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `lumen-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `NativeSelect`, `NativeSelectOption / NativeSelectOptGroup`, and every exported type.
- CSS: the install merges this item's rules (the registry `css` field) into your global stylesheet, in `@layer components`, and adds the lumen foundation (tokens, keyframes, motion levels) once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--lumen-*` custom properties (`--lumen-accent`, `--lumen-accent-text`, `--lumen-bad`, `--lumen-bad-text`, `--lumen-focus`, `--lumen-good`, `--lumen-good-text`, `--lumen-hairline`, `--lumen-ink`, `--lumen-muted-ink`, `--lumen-series-1`, `--lumen-series-2`, `--lumen-series-3`, `--lumen-series-4`, `--lumen-series-5`, `--lumen-series-6`, `--lumen-warn`, `--lumen-warn-text`); this item's CSS also reads `--lumen-font-sans`, `--lumen-radius-k`. Never add Tailwind colour classes inside the component.

```tsx
import { NativeSelect, NativeSelectOption } from "@/components/ui/lumen/native-select";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `NativeSelect` | `native-select` | The well and the <select>. |
| `NativeSelectOption / NativeSelectOptGroup` | `native-select-option` | Options. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `GlassSoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/glass-sound.json`, import from `@/components/beautiful-ui/glass-sound`); `GlassSoundToggle` is its mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/lumen/native-select.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- native select, html select, mobile picker, form select, shadcn native select, Lumen
- Forms on phones, and long option lists the OS picks best

### Not when
- Rich options (icons, descriptions): use Select

## Mistakes
- Label it

## Usage

```tsx
import { NativeSelect, NativeSelectOption } from "@/components/ui/lumen/native-select";

<NativeSelect defaultValue="eu">
  <NativeSelectOption value="us">United States</NativeSelectOption>
  <NativeSelectOption value="eu">Europe</NativeSelectOption>
</NativeSelect>
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `size` | `"sm" \| "default"` | `"default"` | 32px or 40px (44px on phones). |

Full docs: https://beautiful-ui.dev/components/lumen-native-select

## Customising
- Colours: set the `--lumen-*` tokens on `:root`, or on a container with the `lumen-scope` class to retheme one area. Add the `lumen-inherit` class to follow your shadcn palette instead (`--chart-N`, `--destructive`).
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| ↑ ↓ | Change the value |

## Motion inventory

| Interaction | What moves |
|---|---|
| Focus | The filament draws along the bottom |

## Accessibility contract (preserve when editing)
- A real <select>: every assistive technology knows it

## Install

Base UI project (a base-* style in components.json):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/lumen-native-select.json
```

Radix project (a radix-*, new-york or default style):

```bash
npx shadcn@latest add https://beautiful-ui.dev/r/radix-nova/lumen-native-select.json
```

Or add the `@beautiful-ui` registry to components.json and run `npx shadcn@latest add @beautiful-ui/lumen-native-select`: the CLI picks the build from your style.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

## Source (Base UI build)

### components/ui/lumen/native-select.tsx

```tsx
/**
 * Native Select (Lumen Halo) v1.0.0 · Beautiful UI
 * Docs: https://beautiful-ui.dev/components/lumen-native-select · Agent prompt: https://beautiful-ui.dev/md/lumen-native-select.md
 * Licensed to the purchaser under the Beautiful UI license: https://beautiful-ui.dev/license
 */
import * as React from "react";
import { cn } from "@/lib/utils";

/*
 * Lumen Native Select. shadcn's Native Select in Lumen Halo: the browser's own <select> (the best
 * picker on phones) in Lumen's recessed well, with the focus filament and a chevron. Same exports,
 * sizes and data-slots as shadcn; server-safe.
 */

type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & { size?: "sm" | "default" };

function NativeSelect({ className, size = "default", ...props }: NativeSelectProps) {
  return (
    <div data-slot="native-select-wrapper" data-size={size} className={cn(`lumen-native-select`, className)}>
      <select data-slot="native-select" data-size={size} className={`lumen-native-select-input lumen-control`} {...props} />
      <svg aria-hidden data-slot="native-select-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className={`lumen-native-select-icon`}>
        <path d="M4 6l4 4 4-4" />
      </svg>
    </div>
  );
}

function NativeSelectOption({ className, ...props }: React.ComponentProps<"option">) {
  return <option data-slot="native-select-option" className={cn(`lumen-native-select-option`, className)} {...props} />;
}

function NativeSelectOptGroup({ className, ...props }: React.ComponentProps<"optgroup">) {
  return <optgroup data-slot="native-select-optgroup" className={cn(`lumen-native-select-option`, className)} {...props} />;
}

export { NativeSelect, NativeSelectOptGroup, NativeSelectOption };
```

### CSS (the registry `css` / `cssVars`, merged into the global stylesheet by the shadcn CLI)

```css
@layer components {
  .lumen-native-select-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 0;
    border: none;
    outline: none;
    --lf-ring: var(--gc-wr);
    --lf-halo: 0 0 0 0 transparent;
    background-color: var(--lf-bg,var(--gc-well));
    box-shadow: inset 0 0 0 1px var(--lf-ring),var(--gc-wellIn),var(--lf-halo);
    background-image: linear-gradient(90deg,transparent,var(--lf-fil,var(--gc-acc)),transparent);
    background-repeat: no-repeat;
    background-position: 50% 100%;
    background-size: 0% 1px;
    font-family: var(--lumen-font-sans, var(--font-sans, var(--font-geist, var(--font-geist-sans, 'Geist')))), system-ui, sans-serif;
    font-weight: 400;
    font-size: var(--lf-fs,14px);
    letter-spacing: normal;
    color: var(--gc-ink);
    caret-color: var(--gc-acc);
    -webkit-appearance: none;
    appearance: none;
    transition: box-shadow var(--gc-t-c) ease,background-size var(--gc-t-fil) cubic-bezier(.22,1,.36,1),background-color var(--gc-t-c) ease;
    height: 40px;
    padding: 0 34px 0 12px;
    border-radius: calc(12px * var(--lumen-radius-k, 1));
    cursor: default;
  }
  .lumen-native-select-input::placeholder {
    color: var(--gc-ph);
    opacity: 1;
  }
  @media (hover:hover) {
    .lumen-native-select-input:hover:not(:disabled) {
      --lf-ring: var(--gc-wrH);
    }
  }
  .lumen-native-select-input:focus,.lumen-native-select-input[data-force="focus"] {
    --lf-ring: color-mix(in srgb, var(--gc-acc) 65%, transparent);
    --lf-halo: 0 0 0 4px color-mix(in srgb, var(--gc-acc) 12%, transparent);
    background-size: calc(100% - 28px) 1px;
  }
  .lumen-native-select-input[aria-invalid="true"] {
    --lf-ring: color-mix(in srgb, var(--gc-bad) 60%, transparent);
    --lf-halo: 0 0 0 4px color-mix(in srgb, var(--gc-bad) 8%, transparent);
    --lf-fil: var(--gc-bad);
    background-size: calc(100% - 28px) 1px;
    animation: lumen-shake-a calc(.38s * var(--gcp-k, 1)) cubic-bezier(.22,1,.36,1);
  }
  .lumen-native-select-input:disabled {
    --lf-ring: var(--gc-wr);
    --lf-bg: var(--gc-wellD);
    opacity: .5;
    cursor: not-allowed;
    -webkit-text-fill-color: var(--gc-ink);
  }
  .lumen-native-select-input:-webkit-autofill {
    -webkit-text-fill-color: var(--gc-ink);
    transition: background-color 100000s 0s;
  }
  .lumen-native-select {
    position: relative;
    width: fit-content;
  }
  .lumen-native-select:has(select:disabled) {
    opacity: .5;
  }
  .lumen-native-select[data-size="sm"] .lumen-native-select-input {
    height: 32px;
    padding-inline-start: 10px;
    border-radius: calc(10px * var(--lumen-radius-k, 1));
    font-size: 13px;
  }
  .lumen-native-select-icon {
    position: absolute;
    top: 50%;
    right: 11px;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: var(--gc-sec);
    pointer-events: none;
  }
  .lumen-native-select-option {
    background: Canvas;
    color: CanvasText;
  }
  @media (max-width: 699px) {
    .lumen-native-select-input {
      height: 44px;
      --lf-fs: 16px;
    }
  }
}
```

The lumen foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/lumen-foundation.json.
