Home / File/ data-picker-with-dropdowns.tsx — ui Source File

data-picker-with-dropdowns.tsx — ui Source File

Architecture documentation for data-picker-with-dropdowns.tsx, a tsx file in the ui codebase. 7 imports, 0 dependents.

File tsx DocumentationAtlas SearchAPI 7 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  156ee552_8000_2f11_1dcd_dc165abb7c72["data-picker-with-dropdowns.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  4b1d2128_46d9_46f0_b915_b6e1925b7876["button"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> 4b1d2128_46d9_46f0_b915_b6e1925b7876
  4bae96d1_8974_035f_9042_62ec299030b9["calendar"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> 4bae96d1_8974_035f_9042_62ec299030b9
  b5f68436_cf6b_fba3_fb29_abf27fd13442["field"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> b5f68436_cf6b_fba3_fb29_abf27fd13442
  97b1d83c_62f2_f7a6_4edb_030a627d9a9d["popover"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> 97b1d83c_62f2_f7a6_4edb_030a627d9a9d
  f9e8c1ea_9de4_3e04_ca27_b15cada2e81e["date-fns"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> f9e8c1ea_9de4_3e04_ca27_b15cada2e81e
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  156ee552_8000_2f11_1dcd_dc165abb7c72 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  style 156ee552_8000_2f11_1dcd_dc165abb7c72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Button } from "@/examples/radix/ui/button"
import { Calendar } from "@/examples/radix/ui/calendar"
import { Field, FieldLabel } from "@/examples/radix/ui/field"
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/examples/radix/ui/popover"
import { format } from "date-fns"
import { ChevronDownIcon } from "lucide-react"

export function DataPickerWithDropdowns() {
  const [date, setDate] = React.useState<Date>()
  const [open, setOpen] = React.useState(false)

  return (
    <Field className="mx-auto w-72">
      <Popover open={open} onOpenChange={setOpen}>
        <FieldLabel htmlFor="date-picker-with-dropdowns-desktop">
          Date
        </FieldLabel>
        <PopoverTrigger asChild>
          <Button
            variant="outline"
            id="date-picker-with-dropdowns-desktop"
            className="justify-start px-2.5 font-normal"
          >
            {date ? format(date, "PPP") : <span>Pick a date</span>}
            <ChevronDownIcon className="ml-auto" />
          </Button>
        </PopoverTrigger>
        <PopoverContent className="w-auto p-0" align="start">
          <Calendar
            mode="single"
            selected={date}
            onSelect={setDate}
            captionLayout="dropdown"
          />
          <div className="flex gap-2 border-t p-2">
            <Button
              variant="outline"
              size="sm"
              className="w-full"
              onClick={() => setOpen(false)}
            >
              Done
            </Button>
          </div>
        </PopoverContent>
      </Popover>
    </Field>
  )
}

Subdomains

Dependencies

  • button
  • calendar
  • date-fns
  • field
  • lucide-react
  • popover
  • react

Frequently Asked Questions

What does data-picker-with-dropdowns.tsx do?
data-picker-with-dropdowns.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, SearchAPI subdomain.
What functions are defined in data-picker-with-dropdowns.tsx?
data-picker-with-dropdowns.tsx defines 1 function(s): DataPickerWithDropdowns.
What does data-picker-with-dropdowns.tsx depend on?
data-picker-with-dropdowns.tsx imports 7 module(s): button, calendar, date-fns, field, lucide-react, popover, react.
Where is data-picker-with-dropdowns.tsx in the architecture?
data-picker-with-dropdowns.tsx is located at apps/v4/examples/radix/data-picker-with-dropdowns.tsx (domain: DocumentationAtlas, subdomain: SearchAPI, directory: apps/v4/examples/radix).

Analyze Your Own Codebase

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

Try Supermodel Free