lara-light-indigo

BlockUI

BlockUI can either block other components or the whole page.

Document
Panel
Basic

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.

Template

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.

Import via Module

import { BlockUI } from 'primereact/blockui';
 
Import via CDN

<script src="https://unpkg.com/primereact/core/core.min.js"></script>
<script src="https://unpkg.com/primereact/blockui/blockui.min.js"></script>
 
Getting Started

BlockUI is controlled using the blocked property, by default target element to block is the child component. In example below, panel gets blocked with a mask when blockedPanel is enabled and gets unblock when the bound variable is set to false.


export const BlockUIDemo = () => {

    const [blockedPanel, setBlockedPanel] = useState(false);

    const blockPanel = () => {
        setBlockedPanel(true);
    }

    const unblockPanel = () => {
        setBlockedPanel(false);
    }

    return (
        <BlockUI blocked={blockedPanel}>
            <Panel header="Header">
                // content
            </Panel>
        </BlockUI>
    );
}
 
Full Screen

In full screen mode, instead of a particular element, the whole document gets blocked. Set fullScreen as true in order to enable this functionality.


<BlockUI blocked={blockedPanel} fullScreen>
    // content
</BlockUI>
 
Properties

Any property as style and class are passed to the main container element. Following are the additional properties to configure the component.

NameTypeDefaultDescription
idstringnullUnique identifier of the element.
blockedbooleanfalseControls the blocked state.
fullScreenbooleanfalseWhen enabled, the whole document gets blocked.
baseZIndexnumber0Base zIndex value to use in layering.
autoZIndexbooleantrueWhether to automatically manage layering.
classNamestringnullStyle class of the element.
styleobjectnullInline style of the element.
templateanynullTemplate of mask.
Events
NameParametersDescription
onBlocked-Fired when the element gets blocked.
onUnblocked-Fired when the element gets unblocked.
Styling

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-blockuiMask element.
p-blockui-documentMask element in full screen mode.
Dependencies

None.

Component Scale

Input Style

Ripple Effect

Free Themes

Built-in component themes created by the PrimeReact Theme Designer.

Bootstrap
Blue
Purple
Blue
Purple
Material Design
Indigo
Deep Purple
Indigo
Deep Purple
Material Design Compact
Indigo
Deep Purple
Indigo
Deep Purple
Tailwind
Tailwind Light
Fluent UI
Blue
PrimeOne Design - 2022 NEW
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
Lara Indigo
Lara Blue
Lara Purple
Lara Teal
PrimeOne Design - 2021
Saga Blue
Saga Green
Saga Orange
Saga Purple
Vela Blue
Vela Green
Vela Orange
Vela Purple
Arya Blue
Arya Green
Arya Orange
Arya Purple
Premium Themes

Premium themes are only available exclusively for PrimeReact Theme Designer subscribers and therefore not included in PrimeReact core.

Soho Light
Soho Dark
Viva Light
Viva Dark
Mira
Nano

Legacy Free Themes

Nova
Nova Alt
Nova Accent
Luna Blue
Luna Green
Luna Amber
Luna Pink
Rhea

Premium Create-React-App Templates

Beautifully crafted premium create-react-app application templates by the PrimeTek design team.

Sakai
Atlantis
Freya
Ultima
Diamond
Sapphire
Serenity
Babylon
Avalon
Apollo
Roma