Forms & selection@neumorphism-ui/label

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/label
Registry JSON

Preview

Clicking a label moves focus to its control.

Installation

Installation: labelnpx shadcn@latest add @neumorphism-ui/label

The 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

ComponentPropTypeDefaultDescription
LabelhtmlForstring—The id of the form control to associate.
LabelchildrenrequiredReact.ReactNode—Text that describes the purpose of the control.
LabelclassNamestring—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.