Ballmac UI home

Label

An accessible form label built on Radix Label that dims itself when the paired peer control is disabled and never selects text on double-click.

Installation

$ pnpm dlx shadcn@latest add @ballmac/label

Usage

import { Label } from "@/components/ballmac/label"

The full example is in the Code tab above.

Accessibility

KeyAction
ClickFocuses or toggles the associated control

Use with AI

Text label for a form control. Pair with htmlFor/id; put the control before it with className="peer" (Checkbox and Switch already are) to get disabled styling. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Label (@ballmac/label) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Naming inputs, textareas, selects, checkboxes and switches
  • Clickable text next to a checkbox or switch

Not for

  • Headings or section titles (use a heading element)
  • Helper or error text under a field (use a p with text-muted-foreground or text-destructive)

Registry JSON: https://ui.ballmac.com/r/label.json

Credits

Based on shadcn/ui Label, adapted by Ballmac. Free to use in personal and commercial projects.

Registry
shadcn/utils