bysages

Date Input

Forms

About

A segmented date (and optional time) input where each part of the date — month, day, year, hour — is its own arrow-navigable, typeable segment inside one field.

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

Code

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

Usage.tsx

import { DateInput } from "@/components/ui/date-input";

export default function DateInputGranularityDemo() {
  return (
    <div
      className="flex w-full max-w-sm items-center justify-center p-8"
      style={{ background: "var(--bs-color-surface-0, var(--background))" }}
    >
      <DateInput.Root granularity="second">
        <DateInput.Label>Date &amp; time</DateInput.Label>
        <DateInput.Control>
          <DateInput.SegmentGroup>
            <DateInput.SegmentContext>
              {(segment) => <DateInput.Segment segment={segment} />}
            </DateInput.SegmentContext>
          </DateInput.SegmentGroup>
        </DateInput.Control>
        <DateInput.HiddenInput />
      </DateInput.Root>
    </div>
  );
}

Dependencies

More by bysages

View all
  • Switch

    Switch

    18
  • Avatar Group

    Avatar Group

    14
  • Typography

    Typography

    12
  • Spinner

    Spinner

    8
  • Block UI

    Block UI

    2
  • Clipboard

    Clipboard

  • Rating Group

    Rating Group

  • Grid

    Grid

More in Forms

View all
  • Form

    Form

    7
  • Contact Form

    Contact Form

    32
  • Login 2

    Login 2

    16
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    94
  • Paper Plane

    Paper Plane

    80
  • Premium Auth

    Premium Auth

    613
  • Authentication Card

    Authentication Card

    52