Select

View registry JSON

Choose from an expanding pill with a gliding highlight, keyboard navigation, and a morphing label.

Install with the shadcn CLI

npx shadcn@4.21.5 add @cavemio/select
First install? Configure @cavemio once

Run npx shadcn@4.21.5 init if shadcn is not set up, then merge this entry into the registries field in your existing components.json. Keep your other settings and registries.

components.json
{
  "registries": {
    "@cavemio": "https://registry.cavemio.dev/r/cavemio-{name}.json"
  }
}

Overview

Choose from an expanding pill with a gliding highlight, keyboard navigation, and a morphing label.

Try choosing a plan, typing to find a language, and scrolling the long list.

import { Select } from "@/components/select";

<Select label="Plan" options={[{ value: "personal", label: "Personal" }, { value: "team", label: "Team" }]} defaultValue="personal" />

Props

PropTypeDescription
optionsSelectOption[]Choices with unique value, label, and optional description.
labelstringVisible label and accessible name.
valuestring | nullControlled selection; use onValueChange to update it.
defaultValuestring | nullInitial uncontrolled selection.
onValueChange(value: string) => voidCalled when a different option is selected.
hint / errorReactNodeSupporting text or validation feedback linked to the control.
disabledbooleanPrevents opening and selection.
hideLabelbooleanVisually hides the label while retaining its accessible name.
blockbooleanFill available width; defaults to true. Compact pills morph their label.
size"sm" | "md"Compact toolbar or regular field height.
align / width"start" | "end" / numberPopup alignment and preferred width, constrained to viewport.
display / renderValuefunctionCustomize selected text or render an icon/value.
classNamestringStyles the field wrapper.