Components · Form & Input
Label
StableAdded v0.0.1
An accessible form label that optionally shows a required asterisk and links to an input via htmlFor.
import { Label } from '@nexub/react';Playground
Props
size
<Label htmlFor="demo">Full name</Label>Examples
Default
Required
With input
States
defaultdisabledsize="sm"size="md"size="lg"tone="neutral"tone="info"tone="success"tone="warning"tone="danger"tone="leap"tone="bookub"tone="payub"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| htmlFor | string | — | Associates the label with a form control by its id. |
| required | boolean | — | Renders a required indicator (asterisk) after the label text. |
| disabled | boolean | — | Applies disabled styling to the label. |
| size | 'sm' | 'md' | 'lg' | 'md' | Controls label font size. |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'leap' | 'bookub' | 'payub' | 'founderub' | — |
On iOS & Android
Web only
Label has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.