HextaUI

Date input (UI SDK): Date and time

granularity set to "hour", "minute" or "second" adds the time, and the value becomes a local date and time like "2026-11-02T14:30".

import { Label } from "@/components/ui/label"
import { DateInput } from "@/components/ui/ui-sdk-date-input"

function UiSdkDateInputDateTime() {
  return (
    <div className="flex w-full max-w-60 flex-col gap-2">
      <Label id="departure">Departure</Label>
      <DateInput
        aria-labelledby="departure"
        granularity="minute"
        defaultValue="2026-11-02T14:30"
        locale="en-US"
      />
    </div>
  )
}

export { UiSdkDateInputDateTime }

This adds the example as components/examples/ui-sdk-date-input/date-time.tsx, together with the Date input component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/ui-sdk-date-input-date-time.json

To add only the component, follow the Date input installation.

Props in this example

The Date input props this example sets, from the API reference.

PropTypeDefault
defaultValue
string | null–
granularity
"day" | "hour" | "minute" | "second""day"
localeDefaults to the page’s language.
string–

Every prop is in the Date input API reference.

See them all, with keyboard support and accessibility notes, on the Date input page.