native-select
neobrutalism/native-selectFreeComponent
neobrutalism publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by neobrutalism on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://neobrutalism.com/r/native-select.jsonSource
1import * as React from "react"2import { ChevronDownIcon } from "lucide-react"34import { cn } from "@/lib/utils"56type NativeSelectProps = Omit<React.ComponentProps<"select">, "size"> & {7 size?: "sm" | "default"8}910function NativeSelect({11 className,12 size = "default",13 ...props14}: NativeSelectProps) {15 return (16 <div17 className={cn(18 "group/native-select relative w-fit has-[select:disabled]:opacity-50",19 className20 )}21 data-slot="native-select-wrapper"22 data-size={size}23 >24 <select25 data-slot="native-select"26 data-size={size}27 className="h-8 w-full min-w-0 appearance-none rounded border-2 bg-input py-2 pr-8 pl-3 text-sm shadow-sm transition-colors outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive data-[size=sm]:h-7 data-[size=sm]:rounded data-[size=sm]:py-0.5"28 {...props}29 />30 <ChevronDownIcon31 className="pointer-events-none absolute top-1/2 right-2.5 size-4 -translate-y-1/2 text-muted-foreground select-none"32 aria-hidden="true"33 data-slot="native-select-icon"34 />35 </div>36 )37}3839function NativeSelectOption({40 className,41 ...props42}: React.ComponentProps<"option">) {43 return (44 <option45 data-slot="native-select-option"46 className={cn("bg-[Canvas] text-[CanvasText]", className)}47 {...props}48 />49 )50}5152function NativeSelectOptGroup({53 className,54 ...props55}: React.ComponentProps<"optgroup">) {56 return (57 <optgroup58 data-slot="native-select-optgroup"59 className={cn("bg-[Canvas] text-[CanvasText]", className)}60 {...props}61 />62 )63}6465export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
What it pulls in
npm packages
Files it writes
More from neobrutalism
All 54 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | neobrutalism | Components | Free | 2 deps | |
| alertalert | neobrutalism | Components | Free | 2 deps | |
| alert-dialogalert-dialog | neobrutalism | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | neobrutalism | Components | Free | 1 dep | |
| avataravatar | neobrutalism | Components | Free | 1 dep | |
| badgebadge | neobrutalism | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | neobrutalism | Components | Free | 2 deps | |
| buttonbutton | neobrutalism | Components | Free | 2 deps |
