Combobox
boldkit/comboboxFreeComponent
Searchable dropdown built by composing Popover and Command with neubrutalism styling
Live preview
live · rendered by the registry
Rendered by boldkit on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://boldkit.dev/r/combobox.jsonSource
1import * as React from 'react'2import { ChevronsUpDown, X } from 'lucide-react'3import { cn } from '@/lib/utils'4import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover'5import {6 Command,7 CommandEmpty,8 CommandGroup,9 CommandInput,10 CommandItem,11 CommandList,12 CommandSeparator,13} from '@/components/ui/command'1415const Combobox = Popover1617const ComboboxTrigger = React.forwardRef<18 HTMLButtonElement,19 React.ButtonHTMLAttributes<HTMLButtonElement> & {20 placeholder?: string21 value?: string22 open?: boolean23 }24>(({ className, placeholder = 'Select...', value, open, ...props }, ref) => (25 <PopoverTrigger asChild>26 <button27 ref={ref}28 role="combobox"29 aria-expanded={open}30 className={cn(31 'flex h-11 w-full items-center justify-between border-3 border-input bg-background px-4 py-2 text-sm font-medium shadow-[4px_4px_0px_hsl(var(--shadow-color))] focus:outline-none focus:translate-x-[4px] focus:translate-y-[4px] focus:shadow-none disabled:cursor-not-allowed disabled:opacity-50 transition duration-200',32 className33 )}34 {...props}35 >36 <span className={cn('truncate', !value && 'text-muted-foreground')}>37 {value || placeholder}38 </span>39 <ChevronsUpDown className="ml-2 h-4 w-4 shrink-0 opacity-50 stroke-[2.5]" />40 </button>41 </PopoverTrigger>42))43ComboboxTrigger.displayName = 'ComboboxTrigger'4445/**46 * Multi-select trigger. Each entry in `values` has a `value` (identifier)47 * and a `label` (display text). The `onRemove` callback receives the `value`48 * of the chip that was dismissed, so you can remove it from state directly.49 */50const ComboboxMultiTrigger = React.forwardRef<51 HTMLButtonElement,52 React.ButtonHTMLAttributes<HTMLButtonElement> & {53 placeholder?: string54 values?: { value: string; label: string }[]55 open?: boolean56 onRemove?: (value: string) => void57 }58>(({ className, placeholder = 'Select...', values = [], open, onRemove, ...props }, ref) => (59 <PopoverTrigger asChild>60 <button61 ref={ref}62 role="combobox"63 aria-expanded={open}64 className={cn(65 'flex min-h-11 w-full flex-wrap items-center gap-1.5 border-3 border-input bg-background px-3 py-2 text-sm font-medium shadow-[4px_4px_0px_hsl(var(--shadow-color))] focus:outline-none focus:translate-x-[4px] focus:translate-y-[4px] focus:shadow-none disabled:cursor-not-allowed disabled:opacity-50 transition duration-200',66 className67 )}68// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from boldkit
All 94 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | boldkit | Components | Free | 2 deps | |
| Alertalert | boldkit | Components | Free | 2 deps | |
| Alert Dialogalert-dialog | boldkit | Components | Free | 1 dep | |
| ASCII Shapesascii-shapes | boldkit | Components | Free | no deps | |
| Aspect Ratioaspect-ratio | boldkit | Components | Free | 1 dep | |
| Avataravatar | boldkit | Components | Free | 1 dep | |
| Badgebadge | boldkit | Components | Free | 1 dep | |
| Breadcrumbbreadcrumb | boldkit | Components | Free | 2 deps |
