ComboboxForm() — ui Function Reference
Architecture documentation for the ComboboxForm() function in combobox-form.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 6e0cebfa_1f8f_df38_763e_0510fd993bcd["ComboboxForm()"] a3e0f877_7f95_4b00_7616_64f93c86e33e["combobox-form.tsx"] 6e0cebfa_1f8f_df38_763e_0510fd993bcd -->|defined in| a3e0f877_7f95_4b00_7616_64f93c86e33e style 6e0cebfa_1f8f_df38_763e_0510fd993bcd fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
deprecated/www/registry/new-york/examples/combobox-form.tsx lines 52–141
export default function ComboboxForm() {
const form = useForm<z.infer<typeof FormSchema>>({
resolver: zodResolver(FormSchema),
})
function onSubmit(data: z.infer<typeof FormSchema>) {
toast({
title: "You submitted the following values:",
description: (
<pre className="mt-2 w-[340px] rounded-md bg-slate-950 p-4">
<code className="text-white">{JSON.stringify(data, null, 2)}</code>
</pre>
),
})
}
return (
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
<FormField
control={form.control}
name="language"
render={({ field }) => (
<FormItem className="flex flex-col">
<FormLabel>Language</FormLabel>
<Popover>
<PopoverTrigger asChild>
<FormControl>
<Button
variant="outline"
role="combobox"
className={cn(
"w-[200px] justify-between",
!field.value && "text-muted-foreground"
)}
>
{field.value
? languages.find(
(language) => language.value === field.value
)?.label
: "Select language"}
<ChevronsUpDown className="opacity-50" />
</Button>
</FormControl>
</PopoverTrigger>
<PopoverContent className="w-[200px] p-0">
<Command>
<CommandInput
placeholder="Search framework..."
className="h-9"
/>
<CommandList>
<CommandEmpty>No framework found.</CommandEmpty>
<CommandGroup>
{languages.map((language) => (
<CommandItem
value={language.label}
key={language.value}
onSelect={() => {
form.setValue("language", language.value)
}}
>
{language.label}
<Check
className={cn(
"ml-auto",
language.value === field.value
? "opacity-100"
: "opacity-0"
)}
/>
</CommandItem>
))}
</CommandGroup>
</CommandList>
</Command>
</PopoverContent>
</Popover>
<FormDescription>
This is the language that will be used in the dashboard.
</FormDescription>
Domain
Subdomains
Source
Frequently Asked Questions
What does ComboboxForm() do?
ComboboxForm() is a function in the ui codebase, defined in deprecated/www/registry/new-york/examples/combobox-form.tsx.
Where is ComboboxForm() defined?
ComboboxForm() is defined in deprecated/www/registry/new-york/examples/combobox-form.tsx at line 52.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free