# Label

An accessible label associated with a control.

## Installation

```bash
npx shadcn@latest add https://landorui.landorestate.com/r/label.json
```

[Registry JSON](https://landorui.landorestate.com/r/label.json)

## Preview

```tsx
import { Label } from "@/components/ui/label";

export function Preview() {
  return <Label htmlFor="email">Email address</Label>;
}
```


## Source

### ui/label.tsx

```tsx
"use client";

import * as React from "react";

import { cn } from "@/lib/utils";

function Label({ className, ...props }: React.ComponentProps<"label">) {
  return (
    <label
      data-slot="label"
      className={cn(
        "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
        className,
      )}
      {...props}
    />
  );
}

export { Label };
```



## Usage

An accessible label associated with a control.

```tsx
import { Label } from "@/components/ui/label";
```

