Skip to content
Drivn logoDrivn

Label

Accessible form label for pairing with inputs, checkboxes, selects, and other form controls.

Preview

Installation

npx drivn add label

Usage

1import { Label } from "@/components/ui/label"
2
3export default function Page() {
4 return (
5 <Label htmlFor="email">Email</Label>
6 )
7}

With Input

With Checkbox

With Select

API Reference

PropTypeDefaultDescription
htmlForstringID of the form element the label is associated with
classNamestringAdditional CSS classes to apply
childrenReactNodeLabel text or content
...propsLabelHTMLAttributesAll standard HTML label attributes are supported