BlockUI can either block other components or the whole page.
Content of the badge is specified using the value property.
import { BlockUIModule } from 'primeng/blockui';
The element to block should be placed as a child of BlockUI and blocked property is required to control the state.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<button type="button" pButton pRipple label="Block" (click)="blockedPanel = true"></button>
<button type="button" pButton pRipple label="Unblock" (click)="blockedPanel = false"></button>
<p-blockUI [target]="pnl" [blocked]="blockedPanel">
<i class="pi pi-lock" style="font-size: 3rem"></i>
</p-blockUI>
<p-panel #pnl header="Header" styleClass="mt-4">
<p class="m-0">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</p-panel>
Enabling fullScreen property controls the document.
<p-blockUI [blocked]="blockedDocument"></p-blockUI>
Following is the list of structural style classes, for theming classes visit theming page.
Name | Element |
---|---|
p-blockui | Mask element. |
p-blockui-document | Mask element in full screen mode. |
BlockUI manages aria-busy state attribute when the UI gets blocked and unblocked. Any valid attribute is passed to the root element so additional attributes like role and aria-live can be used to define live regions.
Component does not include any interactive elements.
API defines helper props, events and others for the PrimeNG BlockUI module.
Name | Type | Default | Description |
---|---|---|---|
blocked | boolean | false | Controls the blocked state. |
target | any | document | Name of the local ng-template variable referring to another component. |
baseZIndex | number | 0 | Base zIndex value to use in layering. |
autoZIndex | boolean | true | Whether to automatically manage layering. |
styleClass | string | false | Style class of the component. |