Install
Pull Select from the barrel for everyday use, or the granular path when you want a tighter bundle.
import { Select } from "@brika/clay";import { Select } from "@brika/clay/components/select";A minimal example
Drop this into a page. Native HTML attributes pass through to the underlying primitive.
'use client';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '@brika/clay/components/select';
/** Basic single-value select for picking a timezone. */
export default function SelectDefaultDemo() {
return (
<Select>
<SelectTrigger className="w-56">
<SelectValue placeholder="Select a timezone" />
</SelectTrigger>
<SelectContent>
<SelectItem value="utc">UTC</SelectItem>
<SelectItem value="america-new_york">America / New York</SelectItem>
<SelectItem value="america-los_angeles">America / Los Angeles</SelectItem>
<SelectItem value="europe-london">Europe / London</SelectItem>
<SelectItem value="europe-paris">Europe / Paris</SelectItem>
<SelectItem value="asia-tokyo">Asia / Tokyo</SelectItem>
</SelectContent>
</Select>
);
}Select, every way
Controlled
Controlled select with an external state readout.
Disabled
The entire select is disabled, no interaction possible.
Disabled Option
A single option marked disabled, users can see it but not select it.
Grouped
Options grouped by region using SelectGroup and SelectLabel.
Accessibility
- Trigger carries
role="combobox"andaria-expanded, no extra markup needed. - Arrow keys navigate options; Home/End jump to first/last; typing ahead filters.
- Selected item receives
aria-selected="true"and a visible check mark. - Disabled items carry
aria-disabled="true"and are skipped by arrow navigation.
Theme tokens
Every CSS variable Select reads, with its default and the
dotted path you'd write in a ThemeConfig JSON
to override it. Set any of these in your theme to retune Select
without touching component code.
Select tokens
24 tokens--select-trigger-containercolorvar(--input-container)components.select.triggerContainerBackground of the select trigger in its resting state.
--select-trigger-labelcolorvar(--input-label)components.select.triggerLabelForeground color of the selected value rendered inside the trigger.
--select-trigger-bordercolorvar(--input-border)components.select.triggerBorderBorder color of the select trigger in its resting state.
--select-trigger-placeholdercolorvar(--input-placeholder)components.select.triggerPlaceholderForeground color of the placeholder shown when no value is selected.
--select-trigger-hover-containercolorvar(--accent)components.select.triggerHoverContainerBackground color of the select trigger on hover (dark theme only by default).
--select-trigger-icon-colorcolorvar(--muted-foreground)components.select.triggerIconColorDefault color of inline SVG icons inside the trigger (chevron, leading icon).
--select-focus-ringcolorvar(--ring)components.select.focusRingColor of the focus ring drawn around the trigger when focus-visible.
--select-invalid-ringcolorvar(--destructive)components.select.invalidRingSingle color driving the invalid state: border uses it directly, ring uses it at 20% (light) / 40% (dark) opacity.
--select-label-colorcolorvar(--muted-foreground)components.select.labelColorForeground color of the SelectLabel section header inside the listbox.
--select-radiusradiusvar(--radius-control)components.select.radiusSelect trigger corner radius.
--select-heightsize2.25remcomponents.select.heightDefault select height.
--select-padding-xsizecalc(var(--spacing) * 3)components.select.paddingXInline padding inside the select.
--select-padding-ysizecalc(var(--spacing) * 2)components.select.paddingYBlock padding inside the select.
--select-gapsizecalc(var(--spacing) * 2)components.select.gapGap between adjacent children inside the select.
--select-border-widthborder-width1pxcomponents.select.borderWidthBorder width on the select. Set non-zero for outline-style variants.
--select-border-styleborder-stylesolidcomponents.select.borderStyleBorder style on the select (`solid`, `dashed`, `double`, `none`).
--select-font-familyfont-familyvar(--font-sans)components.select.fontFamilyTypeface for select.
--select-font-sizefont-sizevar(--text-body-md)components.select.fontSizeFont size for select.
--select-font-weightfont-weight500components.select.fontWeightFont weight for select.
--select-line-heightline-height1.25components.select.lineHeightLine height for select.
--select-letter-spacingletter-spacing0components.select.letterSpacingLetter spacing for select. Useful for caps labels.
--select-text-transformtext-transformnonecomponents.select.textTransformText transform for select (`uppercase`, `lowercase`, `capitalize`, `none`).
--select-durationdurationvar(--motion-standard-duration)components.select.durationTransition duration for select state changes.
--select-easingeasingvar(--motion-standard-easing)components.select.easingTransition easing for select state changes.
Override in a theme
Authoring a theme is plain JSON. Drop overrides under
components.select, the names
are camelCase versions of the variable suffix.
{
"id": "my-theme",
"name": "My Theme",
"description": "...",
"accentSwatches": ["#000"],
"components": {
"select": {
"paddingX": "calc(var(--spacing) * 3)"
}
}
}
Then apply with applyTheme(myTheme)
(see the theming guide),
scope it to a subtree with themeToCssVars(myTheme, mode),
or consume any token directly in your own JSX with the matching Tailwind utility
(e.g. bg-select-…) — see the
chips on each token row.
API reference
Props specific to Select. Native HTML attributes pass through to the underlying primitive, see the component source on GitHub for the full type signature.
<Select />
3 props- stringInitial selected value for uncontrolled mode.
- (value: string) => voidCalled with the next value whenever the user selects an option.
- stringControlled selected value; pair with
onValueChange.
<SelectContent />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectGroup />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectItem />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectLabel />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectScrollDownButton />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectScrollUpButton />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectSeparator />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.
<SelectTrigger />
1 prop- sizedefault
'default''sm' | 'default'Trigger size preset.
<SelectValue />
passthroughNo wrapper-specific props, all attributes pass through to the underlying primitive.