Forms
Label
Renders an accessible label associated with controls.
Installation
Usage
import { Label } from "@/components/ui/label"<Label htmlFor="email">Email</Label>Renders an accessible label associated with controls.
import { useId } from "react";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
export default function Particle() {
const id = useId();
return (
<div className="flex flex-col items-start gap-2">
<Label htmlFor={id}>Email</Label>
<Input
aria-label="Email"
id={id}
placeholder="you@example.com"
type="email"
/>
</div>
);
}
pnpm dlx cnippet@latest add label
import { Label } from "@/components/ui/label"<Label htmlFor="email">Email</Label>