native-select
draco-china-github/native-selectFreeComponent
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/draco-china/shadcn-pro/main/apps/docs/public/r/styles/radix-sera/native-select.jsonSource
1import * as React from "react"23import { cn } from "@/registry/radix-sera/lib/utils"4import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"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-10 w-full min-w-0 appearance-none rounded-none border border-transparent border-b-input bg-transparent py-2 pr-8 pl-0 text-sm transition-[color,border-color] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-b-ring disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-b-destructive data-[size=sm]:h-9 dark:aria-invalid:border-b-destructive/50"28 {...props}29 />30 <IconPlaceholder31 lucide="ChevronDownIcon"32 tabler="IconSelector"33 hugeicons="UnfoldMoreIcon"34 phosphor="CaretDownIcon"35 remixicon="RiArrowDownSLine"36 className="pointer-events-none absolute top-1/2 right-0 size-3.5 -translate-y-1/2 text-muted-foreground select-none"37 aria-hidden="true"38 data-slot="native-select-icon"39 />40 </div>41 )42}4344function NativeSelectOption({45 className,46 ...props47}: React.ComponentProps<"option">) {48 return (49 <option50 data-slot="native-select-option"51 className={cn("bg-[Canvas] text-[CanvasText]", className)}52 {...props}53 />54 )55}5657function NativeSelectOptGroup({58 className,59 ...props60}: React.ComponentProps<"optgroup">) {61 return (62 <optgroup63 data-slot="native-select-optgroup"64 className={cn("bg-[Canvas] text-[CanvasText]", className)}65 {...props}66 />67 )68}6970export { NativeSelect, NativeSelectOptGroup, NativeSelectOption }
Files it writes
More from shadcn/ui
All 201 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | shadcn/ui | Components | Free | no deps | |
| alertalert | shadcn/ui | Components | Free | no deps | |
| alert-dialogalert-dialog | shadcn/ui | Components | Free | no deps | |
| aspect-ratioaspect-ratio | shadcn/ui | Components | Free | no deps | |
| avataravatar | shadcn/ui | Components | Free | no deps | |
| badgebadge | shadcn/ui | Components | Free | no deps | |
| breadcrumbbreadcrumb | shadcn/ui | Components | Free | no deps | |
| buttonbutton | shadcn/ui | Components | Free | no deps |
