# Select

Native select wrapper with semantic token styling.

[All components](https://rickylabs.github.io/netscript/design-system/components/) · [Theme builder](https://rickylabs.github.io/netscript/create/) · [Implementation source](https://github.com/rickylabs/netscript/blob/main/packages/fresh-ui/registry/components/ui/select.tsx)

## Live preview

[Open live select preview](https://rickylabs.github.io/netscript/assets/fresh-ui/preview/?component=select&theme=studio-utility)

## Install

```bash
netscript ui:add select
```

## Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

```tsx
import { useState } from 'preact/hooks';
import { Select } from '@app/components/ui/select.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><Select aria-label="Shipping method" options={[{value:"standard",label:"Standard · 3–5 business days"},{value:"express",label:"Express · 1–2 business days"}]} /></div><p role="status">{notice}</p></>);
}
```

## Props

Generated from native `deno doc --json --private` over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

| Owner | Prop | Type | Optional | Description |
| --- | --- | --- | --- | --- |
| `SelectProps` | `class` | `string` | Yes |  |
| `SelectProps` | `error` | `boolean` | Yes |  |
| `SelectProps` | `options` | `[object Object]` | No |  |
| `SelectProps` | `placeholder` | `string` | Yes |  |
| `SelectProps` | `selectedValues` | `[object Object]` | Yes |  |

```typescript
SelectProps extends Omit<JSX.SelectHTMLAttributes<HTMLSelectElement>, "class" | "children">
```

## Keyboard

| Key | Action |
| --- | --- |
| `ArrowUp/ArrowDown` | Navigate native options |
| `Enter/Space` | Open or commit native selection |
| `Escape` | Dismiss native picker |

## Tokens

Semantic contract roles: `border/control`, `text/muted`.

CSS custom properties referenced directly: Composed primitives supply their own tokens.

## Contract and compatibility

Accessibility pattern: native select

- Native DOM attributes pass through where the implementation accepts them.
- Text and value anatomy is native control content; custom adornments remain planned.

Design contract values marked planned are not implementation props. The props above describe what ships today.
