Label
A thin wrapper around native label that forwards all standard attributes. Provides text color and cursor styles that match the peer-disabled state.
@neumorphism-ui/labelPreview
Clicking a label moves focus to its control.
Installation
Installation: label
npx shadcn@latest add @neumorphism-ui/labelThe CLI resolves npm dependencies, base tokens, utilities, and component source in order.
New to this Registry? Set up the namespace before continuing.
Usage
Import
Label import code
import { Label } from "@/components/ui/label"Example
Label usage code
<div className="grid gap-2"> <Label htmlFor="project-name">Project name</Label> <Input id="project-name" name="projectName" /> </div>
API Reference
| Component | Prop | Type | Default | Description |
|---|---|---|---|---|
Label | htmlFor | string | — | The id of the form control to associate. |
Label | childrenrequired | React.ReactNode | — | Text that describes the purpose of the control. |
Label | className | string | — | Extends layout and state styles. |
Accessibility
- 01
htmlFor must exactly match the id of the target control.
- 02
To name a group of controls such as RadioGroup, use fieldset and legend or aria-labelledby instead of a standalone Label.
- 03
Communicate required state and supporting descriptions with required and aria-describedby as well as visual indicators.