Components
Loading preview...
Native select in shadcn/ui style
npx shadcn@latest add https://21st.dev/r/originui/select-nativeimport { SelectNative } from "@/components/ui/select-native";
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-[select:disabled]:opacity-50"
>
Select with overlapping label (native)
</label>
<SelectNative id={id} defaultValue="">
<option value="" disabled>
Select framework
</option>
<option value="1">React</option>
<option value="2">Next.js</option>
<option value="3">Astro</option>
<option value="4">Gatsby</option>
</SelectNative>
</div>
);
}
export { Component };