Skip to Content
ComponentsLabel

Label

A text label for form controls with required and disabled states.

Import

import { Label } from '@grannyshot/ui'

Usage

<Label>Username</Label>

Required

Displays a required indicator next to the label text.

<Label required>Email</Label>

Disabled

<Label disabled>Disabled field</Label>

With Form Control

<Label htmlFor="email" required>Email</Label> <Input id="email" placeholder="you@example.com" />

Props

PropTypeDefaultDescription
requiredbooleanfalseShow required indicator
disabledbooleanfalseDisabled style
classNamestringAdditional CSS classes

Extends all native <label> HTML attributes.

Last updated on