import { Select, SelectItem, SelectGroup, SelectLabel, SelectSeparator } from "@styple/design-system";
<Flex
css={{
gap: "$md",
alignItems: "center",
}}
>
<Select defaultValue="1">
<SelectGroup>
<SelectLabel>First</SelectLabel>
<SelectItem value="1">Select 1</SelectItem>
<SelectItem value="2">Select 2</SelectItem>
<SelectItem value="3">Select 3</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Second</SelectLabel>
<SelectItem value="4">Select 4</SelectItem>
<SelectItem value="5">Select 5</SelectItem>
<SelectItem value="6">Select 6</SelectItem>
</SelectGroup>
</Select>
<Select defaultValue="1" size="md">
<SelectItem value="1">Select 1</SelectItem>
<SelectItem value="2">Select 2</SelectItem>
<SelectItem value="3">Select 3</SelectItem>
</Select>
</Flex>
See Radix-UI Select (v0.1.1) for details. This only covers styple abstractions.
A styled abstraction combining Select.Root, Select.Trigger, Select.Value, Select.Icon, Select.Content, Select.ScrollDownButton, Select.ScrollUpButton and Select.Viewport. Takes the props of Select.Root and a variant from the styled trigger:
| Prop | Type | Default | Explanation |
|---|---|---|---|
size | "sm" | "md" | "sm" |
Size variant. |
A styled abstraction combining Select.Item, Select.ItemText and Select.ItemIndicator.
A styled component wrapper for Select.Group.
A styled component wrapper for Select.Label.
A styled component wrapper for Select.Separator.