# Time input (UI SDK): Form

> A hidden input submits the time under `name`. `required` stops an empty or half-typed time, and a reset brings back the default.

Canonical: https://hextaui.com/docs/ui-sdk-time-input/examples/form

Component docs: https://hextaui.com/docs/ui-sdk-time-input

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/ui-sdk-time-input-form.json
```

This adds `components/examples/ui-sdk-time-input/form.tsx` with the Time input component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/ui-sdk-time-input/form.tsx"
"use client"

import * as React from "react"

import { Button } from "@/components/ui/button"
import { Label } from "@/components/ui/label"
import { TimeInput } from "@/components/ui/ui-sdk-time-input"

function UiSdkTimeInputForm() {
  const [submitted, setSubmitted] = React.useState<string | null>(null)

  return (
    <form
      className="flex w-full max-w-40 flex-col gap-3"
      onSubmit={(event) => {
        event.preventDefault()
        const data = new FormData(event.currentTarget)
        setSubmitted(String(data.get("reminder")))
      }}
    >
      <div className="flex flex-col gap-2">
        <Label id="reminder-time">Remind me at</Label>
        <TimeInput
          aria-labelledby="reminder-time"
          name="reminder"
          defaultValue="08:15"
          required
        />
      </div>
      <div className="flex items-center gap-3">
        <Button type="submit" size="sm">
          Save
        </Button>
        <Button type="reset" size="sm" variant="ghost">
          Reset
        </Button>
      </div>
      <p className="m-0 text-sm text-muted-foreground tabular-nums">
        {submitted ? `Submitted ${submitted}` : "Nothing submitted yet."}
      </p>
    </form>
  )
}

export { UiSdkTimeInputForm }
```

## Props in this example

### TimeInput

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `string \| null` | – |  |
| `required` | `boolean` | `false` |  |
| `name` | `string` | – |  |

## More Time input examples

- [Clock and seconds](https://hextaui.com/docs/ui-sdk-time-input/examples/clock)
- [Min and max](https://hextaui.com/docs/ui-sdk-time-input/examples/min-max)
- [Invalid](https://hextaui.com/docs/ui-sdk-time-input/examples/range)
- [Locale](https://hextaui.com/docs/ui-sdk-time-input/examples/locale)
- [Controller](https://hextaui.com/docs/ui-sdk-time-input/examples/controller)
- [Disabled](https://hextaui.com/docs/ui-sdk-time-input/examples/disabled)
- [Read-only](https://hextaui.com/docs/ui-sdk-time-input/examples/read-only)
- [Right to left](https://hextaui.com/docs/ui-sdk-time-input/examples/rtl)
