Headless Button overview
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)
Headless button (Tailwind CSS)
clicked: 0