File: bind.md | Updated: 11/15/2025
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>
Import
Examples


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