# Label

Accessible label that also lays out an inline control and its text.

Docs: https://cozy-ui.solo.engineer/docs/components/label/

Install: `npx shadcn@latest add @cozy/label`

### Usage

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

<Label htmlFor="name">Village name</Label>
```

### Example

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

export default function LabelDemo() {
  return (
    <Label className="cursor-pointer">
      <Checkbox defaultChecked /> Remind me when the rice is ripe
    </Label>
  );
}
```

### Source (components/ui/label.tsx)

```tsx
import * as React from "react";
import { Label as LabelPrimitive } from "radix-ui";
import { cn } from "@/lib/utils";

function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {
  return <LabelPrimitive.Root data-slot="label" className={cn("cz-label", className)} {...props} />;
}

export { Label };
```

npm: `import { Label } from "@0xtrou/cozy-ui"` (after `npm install @0xtrou/cozy-ui` and `import "@0xtrou/cozy-ui/styles.css"`).
