HextaUI

Date input (UI SDK): Read-only

A read-only field takes focus and submits, but keys and typing don’t change it.

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

function UiSdkDateInputReadOnly() {
  return (
    <div className="flex w-full max-w-44 flex-col gap-2">
      <Label id="signed-on">Signed on</Label>
      <DateInput
        aria-labelledby="signed-on"
        defaultValue="2026-11-02"
        readOnly
      />
    </div>
  )
}

export { UiSdkDateInputReadOnly }

This adds the example as components/examples/ui-sdk-date-input/read-only.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-read-only.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–
readOnly
booleanfalse

Every prop is in the Date input API reference.

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