Dropdown

Simple select dropdown supporting both custom styled popup panel and native HTML <select> mobile rendering.

// Plain markup
import { Dropdown } from "@shavin/ui";

Variants

Two rendering modes via the variant prop. Both share the same value / onChange / options API.

Default — styled panel

Component Source
const OPTIONS = [
  { value: "a", label: "Option A" },
  { value: "b", label: "Option B" },
  { value: "c", label: "Option C" },
];

const [value, setValue] = useState("a");

<Dropdown value={value} onChange={setValue} options={OPTIONS} />

Native — OS picker

Component Source
{/* Renders a real <select> — best for simple, mobile-first forms */}
<Dropdown variant="native" value={value} onChange={setValue} options={OPTIONS} />

Appearance

Ghost — no chrome until hover (inline/toolbar filters)

Component Source
<Dropdown appearance="ghost" size="sm" value={value} onChange={setValue} options={OPTIONS} />

States

Disabled

Component Source
<Dropdown value={value} onChange={setValue} options={OPTIONS} disabled />

Select vs Dropdown

Use Dropdown (variant="native") for simple, mobile-first forms — it renders a real <select> and gets the OS picker for free. The default variant is a styled panel for desktop-first UIs. Reach for Select when you also need type-ahead and larger, fully-custom option rows.

Props

PropTypeDefaultDescription
valuestring—Active selected option value string (controlled). Omit and use `defaultValue` for uncontrolled.
defaultValuestring—Initial selected value when uncontrolled.
onChange(v: string) => void—Callback fired when selected option value changes.
onValueChange(v: string) => void—Alias of `onChange`.
options*DropdownOption[]—List of dropdown options ({ value, label }).
disabledboolean—Whether control is disabled.
variant"native" | "default"(customRendering variant: native (<select>) or default (custom popup). Default 'default'.
placement"bottom" | "top"bottomPopup placement relative to trigger: 'bottom' or 'top'. Default 'bottom'.
align"start" | "end"startPopup horizontal alignment relative to trigger: 'start' (left) or 'end' (right). Default 'start'.
ariaLabelstring—Accessible ARIA label.
classNamestring—Optional custom CSS class name.
size"sm" | "md""md"—
appearance"default" | "ghost""default"—

* required

Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font