Getting StartedInstall and bootstrap headless foundations 4
LayoutHeadless structural primitives for expandable and container patterns 6
OverlayHeadless modal and floating layer behavior 3
FeedbackHeadless notification and status communication patterns 5
FormHeadless input and selection contracts 17
UtilityReusable action, identity, and clipboard behavior 6
NavigationHeadless trails, trees, menus, and command surfaces 7

Label overview

label[tngLabel] keeps native label semantics while adding predictable data hooks for required and disabled styling. It works equally well with explicit for/id wiring or wrapped controls.

  • Native click-to-focus behavior stays on the browser label element.
  • data-slot, data-required, and data-disabled are emitted for styling.
  • You keep full ownership of surrounding field layout, helper copy, and required messaging.

Installation

Import the headless directive when you want to own both markup and styling.

Primitive import

ts
import { TngLabel } from '@tailng-ui/primitives';

Basic usage

Prefer explicit for/id for form fields and wrapped labels for compact checkbox rows.

Explicit association

html
<label tngLabel for="workspace-name">Workspace name</label>
<input id="workspace-name" type="text" />

Wrapped checkbox row

html
<label tngLabel>
  <input type="checkbox" />
  Send release alerts
</label>

Style variants

The label contract stays the same while your surrounding shell changes between plain CSS and Tailwind utility styling.

Headless label stack (Plain-CSS)

Accessibility baseline

  • Use for/id when the label and control are separate siblings.
  • If a label is marked required, keep aria-required or native required on the control.
  • Use disabled on the control itself; data-disabled on the label is only a visual hook.