Skip to content

Label

An accessible name associated with a control.

Upstream documentation

Examples

Installation

Run the Ninaero registry command to install the component and its dependencies, including shared theme styles.

Install Label
pnpm dlx shadcn@latest add 'https://ninaero.pages.dev/r/label.json'

Usage

A complete example using the installed component and hook paths.

Label usage
"use client";import { useId } from "react";import { Input } from "@/components/ui/input";import { Label } from "@/components/ui/label";function LabelPreview() {  const id = useId();  return (    <div className="w-full max-w-64 space-y-2">      <Label htmlFor={id}>Project name</Label>      <Input id={id} placeholder="Enter a name" />    </div>  );}export default function Demo() {  return <LabelPreview />;}

API Reference

Ninaero exports and local defaults are listed below. See the upstream reference for inherited primitive props and additional composition examples.

Label

Label props
React.ComponentProps<"label">

Source

Registry JSON