boardui

Time Field

Forms

About

A time-of-day input that lets people type the hour, minute, and AM/PM as separate editable segments, with support for 12/24-hour cycles, seconds, and min/max limits.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Time Field to your project and fits it to your theme.

Code

How Time Field is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import TimeField from "@/components/ui/time-field";
import { useState } from "react";
import { Time } from "@internationalized/date";

export default function TimeFieldDemo() {
  const [opens, setOpens] = useState<Time | null>(new Time(9, 0));
  const [closes, setCloses] = useState<Time | null>(new Time(18, 0));
  const isInvalid =
    opens != null && closes != null && closes.compare(opens) <= 0;
  return (
    <div className="flex w-full max-w-xs flex-col gap-4 p-6">
      <TimeField label="Opens" value={opens} onChange={setOpens} />
      <TimeField
        label="Closes"
        value={closes}
        onChange={setCloses}
        isInvalid={isInvalid}
        hint={isInvalid ? "Must be after opening time." : undefined}
      />
    </div>
  );
}

Dependencies

More by boardui

View all
  • Social Button

    Social Button

    4
  • Modal Dialog

    Modal Dialog

    3
  • Select

    Select

    1
  • Accordion

    Accordion

    1
  • Segmented Control

    Segmented Control

  • Date Calendar

    Date Calendar

  • Composer Loader

    Composer Loader

  • Slider

    Slider

More in Forms

View all
  • Premium Auth

    Premium Auth

    577
  • Login 1

    Login 1

    67
  • Contact Card

    Contact Card

    1.1K
  • Form

    Form

    18
  • Login Card

    Login Card

    36
  • Change Password Form

    Change Password Form

    11
  • Login 2

    Login 2

    15
  • Form

    Form

    3