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>

Templates
Highly customizable application templates to get started in no time with style. Designed and implemented by PrimeTek.
November Sale 2025
Limited coupons for PrimeStore's biggest sale. Claim yours before they're gone!