select
gmhlab/selectFreeComponent
gmhlab publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/gmhlab/monorepo/main/packages/ui/public/r/select.jsonSource
1"use client"23import * as React from "react"4import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"5import { Select as SelectPrimitive } from "radix-ui"67import { cn } from "@/lib/utils"89function Select({10 ...props11}: React.ComponentProps<typeof SelectPrimitive.Root>) {12 return <SelectPrimitive.Root data-slot="select" {...props} />13}1415function SelectGroup({16 ...props17}: React.ComponentProps<typeof SelectPrimitive.Group>) {18 return <SelectPrimitive.Group data-slot="select-group" {...props} />19}2021function SelectValue({22 ...props23}: React.ComponentProps<typeof SelectPrimitive.Value>) {24 return <SelectPrimitive.Value data-slot="select-value" {...props} />25}2627function SelectTrigger({28 className,29 size = "default",30 children,31 ...props32}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {33 size?: "sm" | "default"34}) {35 return (36 <SelectPrimitive.Trigger37 data-slot="select-trigger"38 data-size={size}39 className={cn(40 "border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",41 className42 )}43 {...props}44 >45 {children}46 <SelectPrimitive.Icon asChild>47 <ChevronDownIcon className="size-4 opacity-50" />48 </SelectPrimitive.Icon>49 </SelectPrimitive.Trigger>50 )51}5253function SelectContent({54 className,55 children,56 position = "item-aligned",57 align = "center",58 ...props59}: React.ComponentProps<typeof SelectPrimitive.Content>) {60 return (61 <SelectPrimitive.Portal>62 <SelectPrimitive.Content63 data-slot="select-content"64 className={cn(65// … truncated
What it pulls in
npm packages
Files it writes
More from gmhlab
All 64 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| accordionaccordion | gmhlab | Components | Free | 2 deps | |
| alertalert | gmhlab | Components | Free | 1 dep | |
| alert-dialogalert-dialog | gmhlab | Components | Free | 1 dep | |
| aspect-ratioaspect-ratio | gmhlab | Components | Free | 1 dep | |
| avataravatar | gmhlab | Components | Free | 1 dep | |
| badgebadge | gmhlab | Components | Free | 2 deps | |
| breadcrumbbreadcrumb | gmhlab | Components | Free | 2 deps | |
| buttonbutton | gmhlab | Components | Free | 2 deps |
