ui

Form

A form wrapper component that simplifies validation and submission. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

Examples

Using with Zod

Integrates the Form component with a Zod schema for type-safe client-side validation, showing inline field errors on submit.

Sign In

Email and password fields with a show/hide visibility toggle, a "Forgot password?" link, a "Remember me" checkbox, and a "Create account" fallback.

Profile Settings

A card-wrapped profile editor with first and last name, username (with field description), role select, bio textarea with character hint, and website URL. The save button shows "Saved!" for three seconds after submission.

Contact Form

Name grid, email, topic select, priority radio group, and message textarea. On submit, the form is replaced with a success confirmation state.

Change Password

A card-wrapped form with current password, then new and confirm password fields separated by a divider. Client-side validation checks minimum length and that both new fields match.

Newsletter Signup

A centered card with a mail icon, first/last name grid, email, a "weekly digest" checkbox pre-checked, and a subscribe button. Confirming shows a success state with the submitted email address echoed back.

Multi-step Onboarding

A three-step wizard with a numbered step indicator: step 1 collects name and email, step 2 presents a plan radio group and newsletter preference, step 3 shows a read-only summary before final account creation.

Sign Up

Email, password, and confirm-password fields with a terms checkbox. A minimal register form for new accounts.

Feedback

A rating select paired with a free-text textarea. On submit, the form is replaced with a thank-you confirmation.

Forgot Password

Email input that triggers a reset link. On success, the form swaps to a confirmation card echoing the submitted address with a resend option.

Delete Account

A danger zone confirmation form with a highlighted warning, requiring the user to type a specific phrase before the destructive submit button becomes active.

Invite Team Member

Email address and role select for adding a workspace collaborator, with a role description and cancel/invite action buttons.