Bind

The Bind directive dynamically applies DOM element attributes using properties defined in an object.


import { BindModule } from 'primeng/bind'

The pBind is a directive that accepts an object of HTML attributes.

Static
Dynamic

<div [pBind]="{ 'aria-label': 'basic-box', class: 'bg-primary text-primary-contrast flex items-center justify-center p-4 rounded-lg w-32 font-medium' }">
    Static
</div>

<div [pBind]="boxBinding" pTooltip="Click to change color">
    Dynamic
</div>

PrimeBlocks
490+ ready to use UI blocks crafted with PrimeNG and Tailwind CSS.