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

Headless Button overview

tngPress normalizes button-like behavior on native buttons and anchors without taking over your layout, styling, or content structure.

Imports

Use the directive directly when you want full control over the host element and visuals.

Headless import

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

Basic usage

The primitive adds the right host attributes for disabled, pressed, expanded, and popup states, while leaving the click handling entirely up to you.

Minimal press host

html
<button
  tngPress
  type="button"
  [ariaPressed]="isActive()"
  (click)="isActive.set(!isActive())"
>
  Toggle state
</button>

Style variants

The same primitive behavior rendered with owner-authored Plain CSS and Tailwind shells.

Headless button (Plain CSS)

clicked: 0

Accessibility baseline

  • Use a native button when you can. The primitive only normalizes anchors when you need them.
  • Anchors without href automatically receive role="button" and keyboard activation.
  • Disabled anchors get aria-disabled="true" and are removed from tab order.