Forms
Form layouts, validation, and input patterns
Form Layouts
Single Column Form
Standard form layout for most use cases
This is your public display name.
We'll use this to send you important updates.
Tell us a little bit about yourself. This will be displayed on your profile.
Two Column Form
Compact layout for related fields
The organization you work for.
Form Validation
Error States
How to display validation errors
Please enter a valid email address
Password must be at least 8 characters
Help Text
Providing guidance and context
Username must be 3-20 characters, letters and numbers only
You can find your API key in your account settings
Form Sections
Multi-Section Form
Organizing complex forms into logical sections
Personal Information
Preferences
Receive email updates about your account
Receive emails about new features and updates
Account Type
Form Guidelines
Best Practices
Guidelines for creating effective forms
Layout
- • Use single column for most forms
- • Group related fields together
- • Use consistent spacing (space-y-4)
- • Place labels above inputs
- • Align form elements to the left
- • Include helpful descriptions for complex fields
Validation
- • Validate on blur for better UX
- • Show errors inline with icons
- • Use red borders for error states
- • Provide helpful error messages
- • Include help text for complex fields
- • Use descriptions to prevent errors
Accessibility
- • Associate labels with inputs
- • Use proper ARIA attributes
- • Ensure keyboard navigation works
- • Provide clear focus indicators
- • Use semantic HTML elements
Actions
- • Primary action on the right
- • Secondary actions on the left
- • Use full-width buttons on mobile
- • Disable submit while processing
- • Provide clear action labels