Date Field Validation

PreviousNext

date-field-validation-demo

Docs
intentuipage

Preview

Loading preview…
components/docs/date-and-time/date-field/date-field-validation-demo.tsx
"use client"

import { Form } from "react-aria-components"
import { Button } from "@/components/ui/button"
import { DateField, DateInput } from "@/components/ui/date-field"
import { FieldError, Label } from "@/components/ui/field"

export default function DateFieldValidationDemo() {
  return (
    <Form onSubmit={(e) => e.preventDefault()}>
      <DateField isRequired className="mb-2">
        <Label>Event date</Label>
        <DateInput />
        <FieldError />
      </DateField>
      <Button type="submit">Submit</Button>
    </Form>
  )
}

Installation

npx shadcn@latest add @intentui/date-field-validation-demo

Usage

Usage varies by registry entry. Refer to the registry docs or source files below for details.