Color Field Validation

PreviousNext

color-field-validation-demo

Docs
intentuipage

Preview

Loading preview…
components/docs/colors/color-field/color-field-validation-demo.tsx
"use client"

import { Form } from "react-aria-components"
import { Button } from "@/components/ui/button"
import { ColorField } from "@/components/ui/color-field"
import { FieldError, Label } from "@/components/ui/field"
import { Input } from "@/components/ui/input"

export default function ColorFieldValidationDemo() {
  function submit(e: React.FormEvent) {
    e.preventDefault()
  }

  return (
    <Form onSubmit={submit} className="space-y-4">
      <ColorField isRequired>
        <Label>Color</Label>
        <Input placeholder="#155DFC" />
        <FieldError />
      </ColorField>
      <Button type="submit">Save</Button>
    </Form>
  )
}

Installation

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

Usage

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