combobox
diceui-radix/comboboxFreeComponent
diceui/radix publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/radix-nova/combobox.jsonSource
1import * as ComboboxPrimitive from "@diceui/combobox";2import { Check, ChevronDown, X } from "lucide-react";3import type * as React from "react";45import { cn } from "@/lib/utils";67const Combobox = (({8 className,9 ...props10}: React.ComponentProps<typeof ComboboxPrimitive.Root>) => {11 return (12 <ComboboxPrimitive.Root13 data-slot="combobox"14 className={cn(className)}15 {...props}16 />17 );18}) as ComboboxPrimitive.ComboboxRootComponentProps;1920function ComboboxLabel({21 className,22 ...props23}: React.ComponentProps<typeof ComboboxPrimitive.Label>) {24 return (25 <ComboboxPrimitive.Label26 data-slot="combobox-label"27 className={cn("px-0.5 py-1.5 font-semibold text-sm", className)}28 {...props}29 />30 );31}3233function ComboboxAnchor({34 className,35 ...props36}: React.ComponentProps<typeof ComboboxPrimitive.Anchor>) {37 return (38 <ComboboxPrimitive.Anchor39 data-slot="combobox-anchor"40 className={cn(41 "relative flex h-9 w-full items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 shadow-xs data-focused:ring-1 data-focused:ring-ring",42 className,43 )}44 {...props}45 />46 );47}4849function ComboboxInput({50 className,51 ...props52}: React.ComponentProps<typeof ComboboxPrimitive.Input>) {53 return (54 <ComboboxPrimitive.Input55 data-slot="combobox-input"56 className={cn(57 "flex h-9 w-full rounded-md bg-transparent text-base placeholder:text-muted-foreground focus:outline-hidden disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",58 className,59 )}60 {...props}61 />62 );63}6465function ComboboxTrigger({66 className,67 children,68 ...props69}: React.ComponentProps<typeof ComboboxPrimitive.Trigger>) {70 return (71 <ComboboxPrimitive.Trigger72 data-slot="combobox-trigger"73 className={cn(74 "flex shrink-0 items-center justify-center rounded-r-md border-input bg-transparent text-muted-foreground transition-colors hover:text-foreground/80 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50",75 className,76 )}77 {...props}78 >79 {children || <ChevronDown className="size-4" />}80 </ComboboxPrimitive.Trigger>81 );82}8384function ComboboxCancel({85 className,86 ...props87}: React.ComponentProps<typeof ComboboxPrimitive.Cancel>) {88 return (89 <ComboboxPrimitive.Cancel90 data-slot="combobox-cancel"91 className={cn(92// … truncated
What it pulls in
npm packages
Files it writes
More from diceui/radix
All 58 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| action-baraction-bar | diceui/radix | Components | Free | 1 dep · 2 files | |
| angle-sliderangle-slider | diceui/radix | Components | Free | 1 dep · 3 files | |
| avatar-groupavatar-group | diceui/radix | Components | Free | 1 dep | |
| badge-overflowbadge-overflow | diceui/radix | Components | Free | 1 dep · 2 files | |
| bannerbanner | diceui/radix | Components | Free | 1 dep | |
| checkbox-groupcheckbox-group | diceui/radix | Components | Free | 1 dep | |
| circular-progresscircular-progress | diceui/radix | Components | Free | 1 dep | |
| client-onlyclient-only | diceui/radix | Components | Free | no deps |
