snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
50
apps/v4/examples/aria/select-groups.tsx
Normal file
50
apps/v4/examples/aria/select-groups.tsx
Normal file
@@ -0,0 +1,50 @@
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectLabel,
|
||||
SelectSeparator,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/styles/aria-nova/ui/select"
|
||||
|
||||
export function SelectGroups() {
|
||||
const fruits = [
|
||||
{ label: "Apple", value: "apple" },
|
||||
{ label: "Banana", value: "banana" },
|
||||
{ label: "Blueberry", value: "blueberry" },
|
||||
]
|
||||
const vegetables = [
|
||||
{ label: "Carrot", value: "carrot" },
|
||||
{ label: "Broccoli", value: "broccoli" },
|
||||
{ label: "Spinach", value: "spinach" },
|
||||
]
|
||||
const allItems = [...fruits, ...vegetables]
|
||||
return (
|
||||
<Select placeholder="Select a fruit" className="w-full max-w-48">
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectLabel>Fruits</SelectLabel>
|
||||
{fruits.map((item) => (
|
||||
<SelectItem key={item.value} id={item.value}>
|
||||
{item.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
<SelectSeparator />
|
||||
<SelectGroup>
|
||||
<SelectLabel>Vegetables</SelectLabel>
|
||||
{vegetables.map((item) => (
|
||||
<SelectItem key={item.value} id={item.value}>
|
||||
{item.label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user