FormField
Connect a visible label, help, error and control reliably.
Interactive preview
Use an address you can access.
Usage
import { FormField, Input } from "@devvy-ui/react";
<FormField label="Workspace email" description="Used for project updates." required>{field => <Input {...field} name="email" type="email" />}</FormField>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| label / children | ReactNode / render function | required | Visible label and a control receiving FieldControlProps. |
| description / error | ReactNode | — | Connected help and validation message. |
| required / controlId | boolean / string | false / generated ID | Native required and optional explicit control ID. |
Accessibility & behavior
Platform Behavior & Guidelines
Spread the supplied props on one labelable control. Stable SSR IDs connect label/help/error; error sets aria-invalid. Validation and state belong to your app. Preserve supplied aria-describedby when adding your own descriptions. The forwarded ref targets the field wrapper.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add form-fieldMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.