Skip to content
caliper ui docs

Components

Select

A styled native select for choosing one option from a short list.

Free
pnpm dlx shadcn@latest add @caliper/select

Deploy settings

Atlas platform · production

Installs components/ui/select.tsxDepends on none beyond ReactMotion none in component source

When to use

Use it for

  • Five to fifteen fixed options such as a region or a unit.
  • Forms where native pickers on phones are an advantage.

Skip it when

  • Options need search or grouping; use a combobox.
  • Two to five options; a segmented control is faster.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/select

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. No account needed. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

This is the code behind the preview above.

example.tsx
import { type ReactNode } from "react"
import { Label } from "@/components/ui/label"
import { Select } from "@/components/ui/select"

function Panel({ title, context, className = "max-w-md", children }: { title: string; context: string; className?: string; children: ReactNode }) {
  return (
    <section className={`grid w-full gap-5 rounded-overlay border border-border bg-background p-6 shadow-resting ${className}`}>
      <div className="grid gap-1">
        <p className="font-medium">{title}</p>
        <p className="text-sm text-muted-foreground">{context}</p>
      </div>
      {children}
    </section>
  );
}

export function RegionSelect() {
  return (
    <Panel title="Deploy settings" context="Atlas platform · production" className="max-w-sm">
      <div className="grid gap-1.5">
        <Label htmlFor="docs-region">Primary region</Label>
        <Select id="docs-region" name="region" defaultValue="eu-central-1">
          <option value="eu-central-1">Frankfurt · eu-central-1</option>
          <option value="eu-west-1">Dublin · eu-west-1</option>
          <option value="us-east-1">Ashburn · us-east-1</option>
          <option value="ap-northeast-1">Tokyo · ap-northeast-1</option>
        </Select>
      </div>
    </Panel>
  );
}

API reference

Select

component

No props of its own; it accepts the native props of its root element.

Accessibility

It is built on native elements, so roles and focus come from the browser.

No custom key handling; Tab and the native activation keys do the work.

Motion

It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.

All Inputs examples