Label
Enhanced label component with improved typography, better accessibility, and seamless form integration. Essential for creating accessible and professional forms.
Installation
Install via CLI
moonui add label
Usage
Examples
Basic Usage
Simple label associated with an input field
With Textarea
Label used with a textarea for longer text input
With Checkbox
Label associated with a checkbox for user agreements
With Radio Group
Labels used with radio buttons for single selection
With Switch
Label paired with a switch toggle for settings
Required Field
Label with visual indicator for required fields
With Helper Text
Label with additional helper text for context
Password must be at least 8 characters.
Error State
Label styling for error states with error message
Please enter a valid email address.
With Select Field
Label used with select dropdown components
Form Layout
Complete form layout using labels with various input types
Inline Layout
Horizontal layout with labels and form controls side by side
Accessibility Features
Advanced accessibility features with proper ARIA attributes
Screen readers will announce this description when the input is focused.