Home / Function/ DatePickerSimple() — ui Function Reference

DatePickerSimple() — ui Function Reference

Architecture documentation for the DatePickerSimple() function in date-picker-dob.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  96a92279_8233_e8ba_3167_ebbf14a2eab7["DatePickerSimple()"]
  f7f875c8_0181_e135_8428_e883e023970a["date-picker-dob.tsx"]
  96a92279_8233_e8ba_3167_ebbf14a2eab7 -->|defined in| f7f875c8_0181_e135_8428_e883e023970a
  style 96a92279_8233_e8ba_3167_ebbf14a2eab7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/examples/base/date-picker-dob.tsx lines 13–47

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

  return (
    <Field className="mx-auto w-44">
      <FieldLabel htmlFor="date">Date of birth</FieldLabel>
      <Popover open={open} onOpenChange={setOpen}>
        <PopoverTrigger
          render={
            <Button
              variant="outline"
              id="date"
              className="justify-start font-normal"
            />
          }
        >
          {date ? date.toLocaleDateString() : "Select date"}
        </PopoverTrigger>
        <PopoverContent className="w-auto overflow-hidden p-0" align="start">
          <Calendar
            mode="single"
            selected={date}
            defaultMonth={date}
            captionLayout="dropdown"
            onSelect={(date) => {
              setDate(date)
              setOpen(false)
            }}
          />
        </PopoverContent>
      </Popover>
    </Field>
  )
}

Subdomains

Frequently Asked Questions

What does DatePickerSimple() do?
DatePickerSimple() is a function in the ui codebase, defined in apps/v4/examples/base/date-picker-dob.tsx.
Where is DatePickerSimple() defined?
DatePickerSimple() is defined in apps/v4/examples/base/date-picker-dob.tsx at line 13.

Analyze Your Own Codebase

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

Try Supermodel Free