Label
Provides an accessible text caption for form controls that focuses the corresponding input when clicked.
607 B
•Updated on August 21, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/primitives-labelUsage
Code
import { Label } from '@/components/ui/label'Code
<Label htmlFor="email">Email</Label>API Reference
This is a custom component using Base UI's useRender hook, not a direct Base UI wrapper.
Label
A label component that can be rendered as different elements.
| Prop | Type | Default | Description |
|---|---|---|---|
render | React.ReactElement | - | Render as a different element |
Examples
For accessible labelling and validation, prefer using the FieldLabel component. See some related examples.
With Checkbox
Powered by