About
A composable form field wrapper that pairs a label, input control, helper description and error message for building accessible form layouts.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Field to your project and fits it to your theme.
Code
How Field is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import * as React from "react";
import { Field } from "@/components/ui/field";
export default function FieldDemo() {
return (
<div className="w-full max-w-sm mx-auto p-6">
<Field
label="Username"
htmlFor="username"
required
description="Choose a username for your account"
>
<input
id="username"
type="text"
placeholder="e.g. johndoe"
className="w-full rounded-md border border-input bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
/>
</Field>
</div>
);
}
















![Form [react-aria-components]](https://cdn.21st.dev/cdn-cgi/image/fit=scale-down,width=640,quality=75,format=webp/https://cdn.21st.dev/user_jolbol1/field/814/preview.png)