Components
npx shadcn@latest add https://21st.dev/r/originui/selectLoading preview...
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { useId } from "react";
function Component() {
const id = useId();
return (
<div className="space-y-2 min-w-[300px]">
<Label htmlFor={id}>Select with options groups</Label>
<Select defaultValue="1">
<SelectTrigger id={id}>
<SelectValue placeholder="Select framework" />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Frontend</SelectLabel>
<SelectItem value="1">React</SelectItem>
<SelectItem value="2">Vue</SelectItem>
<SelectItem value="3">Angular</SelectItem>
</SelectGroup>
<SelectGroup>
<SelectLabel>Backend</SelectLabel>
<SelectItem value="4">Node.js</SelectItem>
<SelectItem value="5">Python</SelectItem>
<SelectItem value="6">Java</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
);
}
export { Component };
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...
Loading preview...