Skip to main content

Forms

Forms collect user input and should be clear, accessible, and provide helpful feedback.

Text Inputs

Standard Input

We’ll never share your email.

Input Sizes


Input States

Default State

Default input

Focus State

Focused input

Success State

Email is valid

Error State

invalid-email

Please enter a valid email address

Disabled State

Disabled input

Textarea

Enter a detailed description…

Maximum 500 characters


Select / Dropdown

Select a plan…

Select Options


Checkbox

Unchecked
Checked
Disabled

Radio Buttons

Selected Option
Unselected Option
Another Option

Switch / Toggle

Email notifications
SMS notifications

Date Picker

Pick a date…📅

File Upload

📁

Click to upload or drag and drop

PNG, JPG or GIF (max. 5MB)


Form Layout

Vertical Layout (Default)

Horizontal Layout

John

Grid Layout

John
Smith

Validation Guidelines

  • Mark required fields with an asterisk (*)
  • Place asterisk after the label
  • Use red colour for the asterisk
  • Provide clear error messages when empty
  • Validate on blur (when user leaves field)
  • Show success state for valid inputs
  • Show error state with clear message
  • Don’t validate while user is typing
  • Be specific about what’s wrong
  • Suggest how to fix the error
  • Position below the input field
  • Use destructive colour (#DC3545)
  • Validate all fields before submission
  • Scroll to first error if validation fails
  • Disable submit button during processing
  • Show success message after completion

Accessibility

Labels

Every input must have an associated <label> element with htmlFor attribute.

Error Announcements

Use aria-describedby to link inputs to error messages for screen readers.

Required Fields

Use aria-required="true" in addition to the visual asterisk.

Focus Management

After form submission errors, focus the first invalid field.