# TimeField

Segmented 24-hour time entry with canonical values, bounds and a seconds-based step.

Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.

## Example

```tsx
"use client";

import { FloodRoot, TimeField } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <TimeField label="Start time" name="startTime" defaultValue="09:30" step={300} />
    </FloodRoot>
  );
}
```

## Design notes

- Use HH:mm with minute precision or HH:mm:ss with second precision. Values have no date or timezone.
- step is expressed in seconds and anchored to min or midnight; minute precision requires a multiple of 60. Overnight ranges are not inferred.
- In editable fields, incomplete, invalid, out-of-range, step-mismatched and refused controlled drafts block native submission. Readonly preserves accepted canonical time outside bounds/step alignment; it never accepts a partial or refused draft. Disabled values are excluded.
- Click the control background to focus a missing or remembered segment. Keyboard steps, Home/End, paste and IME preserve host cancellation. Translate segmentLabels and messages. Introduced in 0.2.7.

## API reference

| Prop | Values | Default |
| --- | --- | --- |
| `label` | `string` | `Required` |
| `end` | `ReactNode` | `—` |
| `hideLabel` | `boolean` | `—` |
| `value` | `string` | `—` |
| `defaultValue` | `string` | `—` |
| `onValueChange` | `(value: string) => void` | `—` |
| `precision` | `"minute" \| "second"` | `"minute"` |
| `min` | `string` | `—` |
| `max` | `string` | `—` |
| `step` | `number` | `—` |
| `required` | `boolean` | `—` |
| `readOnly` | `boolean` | `—` |
| `disabled` | `boolean` | `—` |
| `name` | `string` | `—` |
| `form` | `string` | `—` |
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
| `invalid` | `boolean` | `—` |
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
| `description` | `string` | `—` |
| `segmentLabels` | `Partial<Record<"hour" \| "minute" \| "second", string>>` | `—` |
| `messages` | `{ required?: string; invalid?: string; outOfRange?: string; stepMismatch?: string }` | `—` |
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" \| "onChange" \| "children">` | `Forwarded` |
