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
  e58d544b_c913_212f_46c5_bd7c9734f7d7["combobox-demo.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  aa2f3ec6_f291_3763_88ec_65a3f5ad5939["button"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> aa2f3ec6_f291_3763_88ec_65a3f5ad5939
  64c05bed_da32_06a4_3b53_12b3830eb50b["command"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> 64c05bed_da32_06a4_3b53_12b3830eb50b
  e33b0d79_0534_28ec_a112_ac16ee736e09["popover"]
  e58d544b_c913_212f_46c5_bd7c9734f7d7 --> e33b0d79_0534_28ec_a112_ac16ee736e09
  style e58d544b_c913_212f_46c5_bd7c9734f7d7 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/new-york/ui/button"
import {
  Command,
  CommandEmpty,
  CommandGroup,
  CommandInput,
  CommandItem,
  CommandList,
} from "@/registry/new-york/ui/command"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/registry/new-york/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/new-york/internal/sink/components/combobox-demo.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/new-york/internal/sink/components).

Analyze Your Own Codebase

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

Try Supermodel Free