Components
Loading preview...
Enhanced shadcn/ui select
npx shadcn@latest add https://21st.dev/r/originui/selectimport {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { useId } from "react";
function Component() {
const id = useId();
return (
<div className="group relative min-w-[300px]">
<label
htmlFor={id}
className="absolute start-1 top-0 z-10 block -translate-y-1/2 bg-background px-2 text-xs font-medium text-foreground group-has-[:disabled]:opacity-50"
>
Select with overlapping label
</label>
<Select>
<SelectTrigger id={id}>
<SelectValue placeholder="Select framework" />
</SelectTrigger>
<SelectContent>
<SelectItem value="1">React</SelectItem>
<SelectItem value="2">Next.js</SelectItem>
<SelectItem value="3">Astro</SelectItem>
<SelectItem value="4">Gatsby</SelectItem>
</SelectContent>
</Select>
</div>
);
}
export { Component };