Getting Started
Components52
- Accordion
- Alert
- Alert Dialog
- Attachment
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Collapsible
- Command
- Context Menu
- Data Table
- Dialog
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Message Scroller
- Pagination
- Popover
- Progress
- Questionnaire
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toggle
- Toggle Group
- Tooltip
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
export function LabelDemo() {
return (
<div className="flex w-full max-w-xs flex-col gap-1.5">
<Label htmlFor="workspace">Workspace name</Label>
<Input id="workspace" defaultValue="Acme" />
</div>
)
}Installation#
pnpm dlx shadcn@latest add https://ui.ikramhasan.com/r/label.json
Usage#
import { Label } from "@/components/ui/label"<Label htmlFor="email">Your email address</Label>Examples#
Disabled control#
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
export function LabelDisabledControl() {
return (
<div className="flex w-full max-w-xs flex-col gap-1.5">
<Input id="api-key" disabled className="peer order-last" />
<Label htmlFor="api-key">API key</Label>
</div>
)
}API Reference#
Label is built on the Base UI Label primitive. See the Base UI documentation for every prop.