Skip to content
GitHub

Label

Renders an accessible label associated with controls.

import { Checkbox } from "@/components/ui/pxl/checkbox";
import { Label } from "@/components/ui/pxl/label";
export default function LabelDemo() {
return (
<div className="flex gap-2 h-fit">
<Checkbox id="terms" />
<Label htmlFor="terms">Accept terms and conditions</Label>
</div>
);
}
pnpm dlx shadcn@latest add pxl-ui/registry/label
import { Label } from "@/components/ui/pxl/label"
<Label htmlFor="email">Your email address</Label>

For form fields, use the Field component which includes built-in FieldLabel, FieldDescription, and FieldError components.

<Field>
<FieldLabel htmlFor="email">Your email address</FieldLabel>
<Input id="email" />
</Field>