v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

Form

Native form behavior with a composed error summary.

Interactive preview

Used for workspace updates.

Usage

import { Form, FormField, Input, Button } from "@devvy-ui/react";

<Form onSubmit={event => event.preventDefault()}><FormField label="Email" required>{field => <Input {...field} name="email" type="email" />}</FormField><Button type="submit">Continue</Button></Form>

API reference

Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:

PropTypeDefaultDescription
errorSummaryReactNode—Optional alert content after validation.
action / method / onSubmit / onResetnative form propsnative defaultsApplication-owned submission and reset.

Accessibility & behavior

Platform Behavior & Guidelines

Native required/type validation is preserved unless you explicitly opt out. Connect a real submit handler or action in your app. The component does not send data to a service or invent validation rules. Use errors only when present and avoid duplicate live announcements.

Source ownership

Run npx @devvy-ui/cli init once in your React project, then add the source:

npx @devvy-ui/cli add form

Make 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.

Form.tsxREACT / TSX

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.