40+ landing page components for ReactBrowse now

Primitives

Select

Dropdown select input for choosing a single value from a list of options. Supports label, placeholder, error state, and multiple visual variants.

Live Demo

Interactive Select

Installation

npm install @trinkui/react

Import

import { Select } from "@trinkui/react";

Usage

<Select
  label="Framework"
  placeholder="Select a framework"
  options={[
    { value: "react", label: "React" },
    { value: "vue", label: "Vue" },
    { value: "angular", label: "Angular" },
    { value: "svelte", label: "Svelte" },
  ]}
/>

Variants

<Select variant="default" label="Default" options={options} />
<Select variant="filled" label="Filled" options={options} />
<Select variant="ghost" label="Ghost" options={options} />

Sizes

<Select size="sm" options={options} />
<Select size="md" options={options} />
<Select size="lg" options={options} />

Error State

Please select a country.

<Select
  label="Country"
  placeholder="Select a country"
  error="Please select a country."
  options={countries}
/>

Props

PropTypeDefaultDescription
options{ value: string; label: string }[]--Array of selectable options
valuestring--Controlled selected value
defaultValuestring--Initial value (uncontrolled)
onChange(value: string) => void--Callback when the selection changes
placeholderstring--Placeholder text when no option is selected
labelstring--Label text displayed above the select
errorstring--Error message; applies error border styling when set
disabledbooleanfalseDisable the select
variant"default" | "filled" | "ghost""default"Visual style variant
size"sm" | "md" | "lg""md"Size of the select element

Accessibility

  • Uses a native <select> element for full keyboard and screen reader support.
  • Label is associated with the select via htmlFor / id pairing.
  • Error messages are linked with aria-describedby.
  • Arrow keys, Enter, and Space work natively for option navigation.