Select
A select whose list grows out of its button.
Installation#
$ pnpm dlx shadcn@latest add @liquikit/selectNeeds the @liquikit registry in your components.json. Set it up once.
Usage#
import { Select } from "@/components/liquikit/select"<Select.Root items={sizes} defaultValue="medium">
<Select.Trigger aria-label="Text size" />
<Select.Popup>
{sizes.map((size) => (
<Select.Item key={size.value} value={size.value}>
{size.label}
</Select.Item>
))}
</Select.Popup>
</Select.Root>Pass items to Select.Root so the trigger can show the label of the chosen value.
Examples#
Groups#
API Reference#
Select.Root
| Prop | Type | Default |
|---|---|---|
open | booleanWhether the popup is open. Pair it with | — |
Also takes every prop of Base UI's select, plus className and style.
Select.Trigger
| Prop | Type | Default |
|---|---|---|
theme | "light" | "dark"Light or dark glass. Falls back to the nearest | — |
lens | Partial<LensProfile>Overrides for the lens profile, such as | — |
liquid | numberHow far the glass squashes and stretches as it moves. | — |
variant | "glass" | "prominent" | "clear" | — |
size | "small" | "regular" | "large" | — |
icon | boolean | — |
block | boolean | — |
tint | stringColour of the glass body. Accepts any CSS colour. | — |
refraction | "interactive" | "always"When the glass bends the page. | "interactive" |
placeholder | ReactNodeShown until something is chosen. | — |
Select.Popup
| Prop | Type | Default |
|---|---|---|
side | BaseSelect.Positioner.Props["side"]Which side of the trigger the popup opens on. | "bottom" |
align | BaseSelect.Positioner.Props["align"]How the popup lines up with its trigger along that side. | "start" |
sideOffset | BaseSelect.Positioner.Props["sideOffset"]Gap between the trigger and the popup, in pixels. | overTrigger |
theme | "light" | "dark"Light or dark glass. Falls back to the nearest | — |
refraction | "interactive" | "always"When the glass bends the page. | "interactive" |
children | ReactNodeThe content. | — |
Also takes every prop of Base UI's select, plus className and style.