HextaUI

Time 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 { TimeInput } from "@/components/ui/ui-sdk-time-input"

function UiSdkTimeInputReadOnly() {
  return (
    <div className="flex w-full max-w-40 flex-col gap-2">
      <Label id="checkout-time">Checkout</Label>
      <TimeInput
        aria-labelledby="checkout-time"
        defaultValue="11:00"
        readOnly
      />
    </div>
  )
}

export { UiSdkTimeInputReadOnly }

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

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

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

Props in this example

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

PropTypeDefault
defaultValue
string | null–
readOnly
booleanfalse

Every prop is in the Time input API reference.

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