Tac UIv1.1.2

Select

A dropdown selector for choosing a single value from a list of options.

Import

tsx
import { Select } from '@tac-ui/native';

Playground

Interactively configure the Select props below.

Choose an option
tsx
<Select options={options} placeholder="Choose an option" />

Default

The base select renders a styled trigger button that opens a listbox with the available options.

Choose an option
tsx
<Select options={options} placeholder="Choose an option" />

Sizes

Three size variants are available via size: sm, md (default), and lg. Font size scales accordingly.

Small
Choose an option
Medium
Choose an option
Large
Choose an option
tsx
<Select options={options} label="Small" placeholder="Choose an option" size="sm" />
<Select options={options} label="Medium" placeholder="Choose an option" size="md" />
<Select options={options} label="Large" placeholder="Choose an option" size="lg" />

With Helper Text

helperText renders a muted hint below the trigger when there is no active error. The label prop renders an associated label above.

Category
Pick a category
Select the category that best fits.
tsx
<Select options={options} label="Category" placeholder="Pick a category" helperText="Select the category that best fits." />

Error State

Set error to apply destructive border styling and pass errorMessage to display an accessible validation message below the trigger.

Category
Pick a category
Please select a category.
tsx
<Select options={options} label="Category" placeholder="Pick a category" error errorMessage="Please select a category." />

Disabled

When disabled is true the trigger button is non-interactive and the dropdown will not open.

Disabled select
tsx
<Select options={options} placeholder="Disabled select" disabled />

API Reference

PropTypeDefaultDescription
optionsSelectOption[]-Array of { label, value, disabled? } option objects.
labelstring-Label displayed above the select.
placeholderstring"Select an option"Placeholder option shown when no value is selected.
helperTextstring-Helper text displayed below the select when there is no error.
size"sm" | "md" | "lg""md"Visual size of the select element.
valuestring-Controlled selected value.
onChange(value: string) => void-Called when an option is selected.
errorbooleanfalseApplies error styling when true.
errorMessagestring-Error message displayed when error is true.
disabledbooleanfalseDisables the select when true.