# Select

shadcn's select (Radix) in Candor's theme.

- Registry name: `select` (`@candor/select`)
- Tier: Pro. Installing it needs a Pro, Premium or Team licence key: the person runs `npx candor-ui key <key>` themselves; never ask for the key in chat or write it to a file.
- Docs: https://candor.themethodic.com/docs/select

## Install

```bash
npx candor-ui add select
```

Run `npx candor-ui@latest init` once first (https://candor.themethodic.com/get-started.md). Without the CLI: `npx shadcn@latest add @candor/select`.
It brings in: utils.
npm packages: lucide-react@^1.67.0, radix-ui@^1.8.1.

## Example

```tsx
"use client"

import * as React from "react"
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"

export default function Example() {
  // Nothing is chosen until the person chooses.
  const [environment, setEnvironment] = React.useState("")
  return (
    <div className="flex flex-col gap-1.5">
      <span id="example-env" className="text-sm font-medium">
        Run against
      </span>
      <Select value={environment} onValueChange={setEnvironment}>
        <SelectTrigger aria-labelledby="example-env" className="w-56">
          <SelectValue placeholder="Choose an environment" />
        </SelectTrigger>
        <SelectContent>
          <SelectItem value="staging">Staging</SelectItem>
          <SelectItem value="qa">QA</SelectItem>
          <SelectItem value="production">Production</SelectItem>
        </SelectContent>
      </Select>
    </div>
  )
}
```

## <Select>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Root>`.

## <SelectContent>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Content>`.

## <SelectGroup>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Group>`.

## <SelectItem>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Item>`.

## <SelectLabel>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Label>`.

## <SelectScrollDownButton>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>`.

## <SelectScrollUpButton>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>`.

## <SelectSeparator>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Separator>`.

## <SelectTrigger>

Props:

- `size?: "sm" | "default" | undefined` (default `"default"`): Trigger height: 36px by default, 32px for sm.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Trigger>`.

## <SelectValue>

No props.

Also takes the props of `React.ComponentProps<typeof SelectPrimitive.Value>`.

## Rules for using Candor UI

- Components take plain typed data. Never pass model output as HTML or render it as a link; messages are typed blocks.
- A control that can't be used says why: wrap it in `<Locked reason="…">`, don't just disable it.
- Don't show a value you don't have: leave it out (it renders as —) rather than guess. An estimate is labelled as one.
- Nothing is pre-selected in a decision a person makes, and the agent is named from your app's data, never from model output.
- Your app's words go in `LocaleProvider` (fixed strings) and `TermsProvider` (nouns); entity kinds and agent roles in `EntityKindsProvider` and `AgentRolesProvider`.
