Home / File/ combobox-demo.tsx — ui Source File

combobox-demo.tsx — ui Source File

Architecture documentation for combobox-demo.tsx, a tsx file in the ui codebase. 6 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 6 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  8e89b312_9c22_dc46_86e3_971e72f07001["combobox-demo.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  d418ad18_b947_f4e5_6e4c_01100d7a63e4["button"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> d418ad18_b947_f4e5_6e4c_01100d7a63e4
  546c6954_c407_41fc_2cb8_f5db98d487e2["command"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> 546c6954_c407_41fc_2cb8_f5db98d487e2
  d1761ea6_65b9_f5fd_76e0_66663b00b300["popover"]
  8e89b312_9c22_dc46_86e3_971e72f07001 --> d1761ea6_65b9_f5fd_76e0_66663b00b300
  style 8e89b312_9c22_dc46_86e3_971e72f07001 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Check, ChevronsUpDown } from "lucide-react"

import { cn } from "@/lib/utils"
import { Button } from "@/registry/default/ui/button"
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
} from "@/registry/default/ui/command"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/registry/default/ui/popover"

const frameworks = [
  {
    value: "next.js",
    label: "Next.js",
  },
  {
    value: "sveltekit",
    label: "SvelteKit",
  },
  {
    value: "nuxt.js",
    label: "Nuxt.js",
  },
  {
    value: "remix",
    label: "Remix",
  },
  {
    value: "astro",
    label: "Astro",
  },
]

export function ComboboxDemo() {
  const [open, setOpen] = React.useState(false)
  const [value, setValue] = React.useState("")

  return (
    <Popover open={open} onOpenChange={setOpen}>
      <PopoverTrigger asChild>
        <Button
          variant="outline"
          role="combobox"
          aria-expanded={open}
          className="w-[200px] justify-between"
        >
          {value
            ? frameworks.find((framework) => framework.value === value)?.label
            : "Select framework..."}
          <ChevronsUpDown className="opacity-50" />
        </Button>
      </PopoverTrigger>
      <PopoverContent className="w-[200px] p-0">
        <Command>
          <CommandInput placeholder="Search framework..." className="h-9" />
          <CommandList>
            <CommandEmpty>No framework found.</CommandEmpty>
            <CommandGroup>
              {frameworks.map((framework) => (
                <CommandItem
                  key={framework.value}
                  value={framework.value}
                  onSelect={(currentValue) => {
                    setValue(currentValue === value ? "" : currentValue)
                    setOpen(false)
                  }}
                >
                  {framework.label}
                  <Check
                    className={cn(
                      "ml-auto",
                      value === framework.value ? "opacity-100" : "opacity-0"
                    )}
                  />
                </CommandItem>
              ))}
            </CommandGroup>
          </CommandList>
        </Command>
      </PopoverContent>
    </Popover>
  )
}

Subdomains

Functions

Dependencies

  • button
  • command
  • lucide-react
  • popover
  • react
  • utils

Frequently Asked Questions

What does combobox-demo.tsx do?
combobox-demo.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in combobox-demo.tsx?
combobox-demo.tsx defines 1 function(s): ComboboxDemo.
What does combobox-demo.tsx depend on?
combobox-demo.tsx imports 6 module(s): button, command, lucide-react, popover, react, utils.
Where is combobox-demo.tsx in the architecture?
combobox-demo.tsx is located at deprecated/www/registry/default/internal/sink/components/combobox-demo.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/internal/sink/components).

Analyze Your Own Codebase

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

Try Supermodel Free