preskok/ui

Core field components including Label, Description, FieldError, Fieldset, and Legend.

Installation

pnpm dlx @preskok-org/ui@latest add field

Usage

import { Form } from "react-aria-components"
 
import {
  Description,
  FieldError,
  Fieldset,
  Label,
  Legend,
} from "@/registry/preskok/ui/preskok-ui/field"
import { Input } from "@/registry/preskok/ui/preskok-ui/input"
import { TextField } from "@/registry/preskok/ui/preskok-ui/text-field"
 
export function Example() {
  return (
    <Form>
      <Fieldset>
        <Legend>Profile information</Legend>
        <TextField isRequired name="email">
          <Label>Email</Label>
          <Input type="email" />
          <Description>We will never share your email.</Description>
          <FieldError />
        </TextField>
      </Fieldset>
    </Form>
  )
}

Components

  • Label - Form field label
  • Description - Helper text for fields
  • FieldError - Error message display
  • Fieldset - Groups related form fields
  • Legend - Title for fieldset groups

Note

The Input component has been moved to a separate component. See the Input documentation for usage.