Component · C-062
Label
The visible label of a control. Inside Field it connects itself; outside Field it uses htmlFor and keeps the same look and focus.
Install
Install koten-theme first when the project has no Koten tokens yet.
npx shadcn@latest add https://koten.codehive.com.co/r/label.jsonAccessibility
- Every control needs a visible label; the placeholder only assists and disappears once the user types.
- Outside Field, htmlFor must match the control id exactly.
- The required asterisk is aria-hidden: convey the requirement with the required attribute or with text as well.
- Do not nest links or buttons inside the label; a click should activate only the control.