"use client"
import { Select } from "@/components/ui/preskok-ui/select"
export const cars = [
{ id: 1, name: "Audi" },
{ id: 2, name: "BMW" },
{ id: 3, name: "Mercedes-Benz" },
{ id: 4, name: "Volkswagen" },
{ id: 5, name: "Ford" },
]
export function SelectDemo() {
return (
<Select aria-label="Cars" placeholder="Select a car">
<Select.Trigger />
<Select.List items={cars}>
{(item) => (
<Select.Option id={item.id} textValue={item.name}>
{item.name}
</Select.Option>
)}
</Select.List>
</Select>
)
}
Installation
CLI
Manual
pnpmnpmyarnbunpnpm dlx @preskok-org/ui@latest add select
Usage
import { Select } from "@/registry/preskok/ui/preskok-ui/select"
export function SelectDemo() {
return (
<Select
label="Project"
defaultSelectedKey="1"
items={[{ id: "1", name: "Alpha" }]}
>
{(item) => <span>{item.name}</span>}
</Select>
)
}