Home / Function/ ComboboxPopover() — ui Function Reference

ComboboxPopover() — ui Function Reference

Architecture documentation for the ComboboxPopover() function in combobox-popover.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  83e0748b_80ca_5c67_9667_404b26e8bf54["ComboboxPopover()"]
  bc41868e_0163_3dc4_13a0_5c17122d7990["combobox-popover.tsx"]
  83e0748b_80ca_5c67_9667_404b26e8bf54 -->|defined in| bc41868e_0163_3dc4_13a0_5c17122d7990
  style 83e0748b_80ca_5c67_9667_404b26e8bf54 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

deprecated/www/registry/default/examples/combobox-popover.tsx lines 63–125

export default function ComboboxPopover() {
  const [open, setOpen] = React.useState(false)
  const [selectedStatus, setSelectedStatus] = React.useState<Status | null>(
    null
  )

  return (
    <div className="flex items-center space-x-4">
      <p className="text-sm text-muted-foreground">Status</p>
      <Popover open={open} onOpenChange={setOpen}>
        <PopoverTrigger asChild>
          <Button
            variant="outline"
            size="sm"
            className="w-[150px] justify-start"
          >
            {selectedStatus ? (
              <>
                <selectedStatus.icon className="mr-2 h-4 w-4 shrink-0" />
                {selectedStatus.label}
              </>
            ) : (
              <>+ Set status</>
            )}
          </Button>
        </PopoverTrigger>
        <PopoverContent className="p-0" side="right" align="start">
          <Command>
            <CommandInput placeholder="Change status..." />
            <CommandList>
              <CommandEmpty>No results found.</CommandEmpty>
              <CommandGroup>
                {statuses.map((status) => (
                  <CommandItem
                    key={status.value}
                    value={status.value}
                    onSelect={(value) => {
                      setSelectedStatus(
                        statuses.find((priority) => priority.value === value) ||
                          null
                      )
                      setOpen(false)
                    }}
                  >
                    <status.icon
                      className={cn(
                        "mr-2 h-4 w-4",
                        status.value === selectedStatus?.value
                          ? "opacity-100"
                          : "opacity-40"
                      )}
                    />
                    <span>{status.label}</span>
                  </CommandItem>
                ))}
              </CommandGroup>
            </CommandList>
          </Command>
        </PopoverContent>
      </Popover>
    </div>
  )
}

Subdomains

Frequently Asked Questions

What does ComboboxPopover() do?
ComboboxPopover() is a function in the ui codebase, defined in deprecated/www/registry/default/examples/combobox-popover.tsx.
Where is ComboboxPopover() defined?
ComboboxPopover() is defined in deprecated/www/registry/default/examples/combobox-popover.tsx at line 63.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free