# Priority select with colored badges

> Priority select with colored badges

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-select-30).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-select-30
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-select-30-light-5ebdc3031d6b3e95.png
- Registry item: https://reui.io/r/new-york-v4/c-select-30.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-select-30.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `@reui/badge`, `field`, `select`

## Files

### `c-select-30.tsx`

```tsx
import { Badge } from "@/components/reui/badge"

import { Field } from "@/components/ui/field"
import {
  Select,
  SelectContent,
  SelectGroup,
  SelectItem,
  SelectTrigger,
  SelectValue,
} from "@/components/ui/select"

const priorities = [
  { value: "none", label: "No Priority", variant: "outline" as const },
  { value: "urgent", label: "Urgent", variant: "destructive" as const },
  { value: "high", label: "High", variant: "warning" as const },
  { value: "medium", label: "Medium", variant: "warning-light" as const },
  { value: "low", label: "Low", variant: "info" as const },
]

export function Pattern() {
  return (
    <Field className="max-w-xs">
      <Select defaultValue={priorities[0].value} items={priorities}>
        <SelectTrigger className="w-[200px]">
          <SelectValue>
            {(item: (typeof priorities)[number]) => (
              <span className="flex items-center gap-2">
                {item ? (
                  <Badge variant={item.variant} size="sm">
                    {item.label}
                  </Badge>
                ) : null}
              </span>
            )}
          </SelectValue>
        </SelectTrigger>
        <SelectContent alignItemWithTrigger={false}>
          <SelectGroup>
            {priorities.map((priority) => (
              <SelectItem key={priority.value} value={priority}>
                <span className="flex items-center gap-2">
                  <Badge variant={priority.variant} size="sm">
                    {priority.label}
                  </Badge>
                </span>
              </SelectItem>
            ))}
          </SelectGroup>
        </SelectContent>
      </Select>
    </Field>
  )
}
```
