packages/components/eui-block-content/eui-block-content.component.ts
Component that wraps content and manages focus state when content is blocked. Provides accessibility attributes and handles focus restoration when blocking/unblocking.
<eui-block-content [isBlocked]="isLoading">
<form>
<input type="text" />
<button>Submit</button>
</form>
</eui-block-content><eui-block-content
role="region"
ariaLabel="User profile section"
[isBlocked]="isSaving">
<div>Content that can be blocked</div>
</eui-block-content>isLoading = true;
loadData(): void {
this.isLoading = true;
this.service.getData().subscribe(() => {
this.isLoading = false;
});
}| changeDetection | ChangeDetectionStrategy.OnPush |
| host | { |
| selector | eui-block-content |
| styleUrls | ./eui-block-content.scss |
| template | |
Properties |
Inputs |
constructor()
|
| ariaLabel |
Type : string
|
Default value : 'block content wrapper'
|
|
ARIA label for the content wrapper |
| isBlocked |
Default value : false, { transform: booleanAttribute }
|
|
Whether the content is currently blocked When true, focused elements within will be blurred and state saved |
| role |
Type : string
|
Default value : 'region'
|
|
ARIA role for the content wrapper |
| cssClasses |
Type : unknown
|
Default value : computed(() => [
'eui-block-content',
this.isBlocked() ? 'eui-block-content--blocked' : '',
].join(' ').trim())
|