Binhlaig UI Component

Form

Accessible layout primitives for labels, controls, helper text, validation messages, sections and actions.

Installation

Initialize Binhlaig UI and install Form using your preferred installer.

Initialize first

npx binhlaig-ui@latest init
Terminal
npx binhlaig-ui@latest add form

Import

Import the Form layout primitives from your UI directory.

import {
  Form,
  FormActions,
  FormControl,
  FormDescription,
  FormField,
  FormLabel,
  FormMessage,
  FormSection,
  FormSectionDescription,
  FormSectionHeader,
  FormSectionTitle,
} from "@/components/ui/form"

Usage

Build a basic form using field, label, control and action primitives.

Validation

Use FormDescription and FormMessage to communicate field state.

We will never share your email.

Form Sections

Group related fields in a bordered section.

Profile information

Update your public profile details.

Checkbox and Select

Form primitives work with native controls and custom UI components.

Receive updates about your account.

React Hook Form

Connect Binhlaig Form layout primitives to React Hook Form for typed values, validation errors and submission state.

Install React Hook Form

npm install react-hook-form

We will only use this email to reply.

Submit State

Disable the submit action and show progress while saving.

Update or Overwrite

Replace an older Form source with the latest registry version.

npx binhlaig-ui@latest add form --overwrite

API Reference

Components included in the Binhlaig UI Form layout.

ComponentPurpose
FormRoot form layout.
FormFieldGroups a single field.
FormLabelAccessible field label.
FormControlWraps an input control.
FormDescriptionDisplays helper text.
FormMessageDisplays validation feedback.
FormSectionGroups related fields.
FormSectionHeaderGroups section heading text.
FormSectionTitleSection heading.
FormSectionDescriptionSection supporting text.
FormActionsAligns submit and cancel actions.