Skip to main content
Neural UIv2.0.0Documentation
View v1 GitHub

BlockUI

Temporarily block a local region with an overlay, or make a subtree inert with a directive.

Category
Feedback and status
Import
@neural-ui/core/block-ui
Selector
neu-block-ui
import { NeuBlockUIComponent } from '@neural-ui/core/block-ui';

Usage

Place neu-block-ui inside a position:relative container, alongside the controls it blocks. blocked shows the overlay, spinner and optional message; variant selects default, light or dark. Controls outside that container remain available. For non-visual blocking, put [neuBlockUI] on the content container instead: the directive makes that subtree inert without adding an overlay.

Examples

Try the interaction and open Code for the complete implementation.

Examples

Report settings

Report available ยท Actions: 0

Try and configure

Change the options, try the result and see the template update. Code contains the full executable example.

Try and configure

Report settings

Report available ยท Actions: 0

Template generated from your current options. Open Code for the complete example.

template.html
<div class="report-region">
  <neu-block-ui
    [blocked]="false"
    variant="default"
    message="Preparing your reportโ€ฆ"
  />
  <form><!-- Your report controls --></form>
</div>

/* styles.css */
.report-region { position: relative; }

Directive blocking

Try [neuBlockUI] directly on the report content. It blocks interaction and sets aria-busy, but does not render a spinner or a message. The external toggle stays usable.

Directive blocking

Report settings

Report available ยท Actions: 0

Data and content

The application owns blocked and the operation that changes it. The component makes sibling controls inert while active and restores their prior state when released or destroyed. Keep the unblock action outside the blocked region. Neither the component nor the directive has Outputs or Templates.

Accessibility and keyboard

Provide a useful status message; the overlay announces it politely. Blocking removes underlying controls from keyboard interaction, so keep a reachable way to cancel or finish the operation. Avoid blocking an entire page for a local task. The spinner respects reduced motion.

Key
Action
โ€” The blocking surface has no keyboard action of its own. Underlying controls are blocked; provide an accessible cancel/finish action outside the blocked content.

API

Inputs and Outputs match the installed package. Named types link to definitions. Every available Template has a Demo and Code example.

Inputs

Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.

Name
Type
Default
Template binding
Description
blockedbooleanfalse[blocked]Show the blocking overlay and make sibling controls inert.
messagestring''[message]Optional status text inside the overlay.
variant"default" | "light" | "dark"'default'[variant]Overlay appearance: default, light or dark.

Templates

ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.

This component does not expose content projection or public customization templates.

Related directives

Name
Contract
NeuBlockUIDirective[neuBlockUI]

Styles and tokens

Customize supported public tokens and check both themes. Example illustrations and application state are not Core inputs.

Specific tokens

Token
Purpose
State / variant
Default / source
Fallback
--neu-block-ui-bg Inherited theme value used by this component Field surface rgba(255, 255, 255, 0.6)Root declarationNo token alias
--neu-block-ui-radius Corner radius Field surface var(--neu-radius-lg)Root declaration--neu-radius-lg

Shared tokens used

Override these on a local wrapper to affect this example. An override on :root affects other components that use the same token.

Token
Purpose here
Other impact
Default / fallback
--neu-primary Brand color for active controls and emphasis Shared by other Core consumers; scope the override. #007aff
--neu-text Main text and inherited icon color Shared by other Core consumers; scope the override. #0f172a
--neu-space-4 Spacing between content and controls Shared by other Core consumers; scope the override. 1rem
--neu-spinner-track Inherited theme value used by this component Shared by other Core consumers; scope the override. var(--neu-surface-3)