LabelA text label component that provides names for form controls.
Import all parts and piece them together.
The Label component accepts the following props:
The Label component is designed with accessibility in mind:
Install the component from your command line.
npm install @raystack/apsara
import { Label } from '@raystack/apsara/v1' <Label size="small">Small Label</Label> <Label size="medium" required>Required Label</Label> <Label size="large">Large Label</Label>
size
:"small" | "medium" | "large"
- Controls the size of the label (default: "small")required
:boolean
- When true, shows a required field indicatorrequiredIndicator
:string
- Customizes the required field indicator (default: "*")htmlFor
:string
- Associates the label with a form control using its IDclassName
:string
- Additional CSS class names
loading...
- Uses semantic HTML
<label>
element - Supports programmatic association with form controls via
htmlFor
- Required indicators are properly hidden from screen readers
- Maintains WCAG compliant color contrast ratios
- Supports keyboard navigation when used with form controls