combobox
agentmesh/comboboxFreeComponent
shadcn/ui publishes no description for this item.
Live preview
live · rendered by the registry
Rendered by shadcn/ui on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://raw.githubusercontent.com/ombhanushaliii/agentmesh/main/example/ui/apps/v4/public/r/styles/base-vega/combobox.jsonSource
1"use client"23import * as React from "react"4import { Combobox as ComboboxPrimitive } from "@base-ui/react"56import { cn } from "@/registry/base-vega/lib/utils"7import { Button } from "@/registry/base-vega/ui/button"8import {9 InputGroup,10 InputGroupAddon,11 InputGroupButton,12 InputGroupInput,13} from "@/registry/base-vega/ui/input-group"14import { IconPlaceholder } from "@/app/(create)/components/icon-placeholder"1516const Combobox = ComboboxPrimitive.Root1718function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {19 return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />20}2122function ComboboxTrigger({23 className,24 children,25 ...props26}: ComboboxPrimitive.Trigger.Props) {27 return (28 <ComboboxPrimitive.Trigger29 data-slot="combobox-trigger"30 className={cn("[&_svg:not([class*='size-'])]:size-4", className)}31 {...props}32 >33 {children}34 <IconPlaceholder35 lucide="ChevronDownIcon"36 tabler="IconChevronDown"37 hugeicons="ArrowDown01Icon"38 phosphor="CaretDownIcon"39 remixicon="RiArrowDownSLine"40 className="pointer-events-none size-4 text-muted-foreground"41 />42 </ComboboxPrimitive.Trigger>43 )44}4546function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {47 return (48 <ComboboxPrimitive.Clear49 data-slot="combobox-clear"50 render={<InputGroupButton variant="ghost" size="icon-xs" />}51 className={cn(className)}52 {...props}53 >54 <IconPlaceholder55 lucide="XIcon"56 tabler="IconX"57 hugeicons="Cancel01Icon"58 phosphor="XIcon"59 remixicon="RiCloseLine"60 className="pointer-events-none"61 />62 </ComboboxPrimitive.Clear>63 )64}6566function ComboboxInput({67 className,68 children,69 disabled = false,70 showTrigger = true,71 showClear = false,72 ...props73}: ComboboxPrimitive.Input.Props & {74 showTrigger?: boolean75 showClear?: boolean76}) {77 return (78 <InputGroup className={cn("w-auto", className)}>79 <ComboboxPrimitive.Input80 render={<InputGroupInput disabled={disabled} />}81 {...props}82 />83 <InputGroupAddon align="inline-end">84 {showTrigger && (85 <InputGroupButton86 size="icon-xs"87 variant="ghost"88 render={<ComboboxTrigger />}89 data-slot="input-group-button"90 className="group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent"91// … truncated
What it pulls in
npm packages
Other registry items
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 |
