@bimetal/overlay-angular-components
v0.42.0
Published
Angular render layer for the BIMETAL overlay family — Dialog (standalone component) over the canonical overlay controller.
Maintainers
Readme
@bimetal/overlay-angular-components
Angular render layer for the BIMETAL overlay family — currently Dialog
(<bm-dialog>, standalone), a thin binding over the canonical @bimetal/overlay-headless
controller (port of the React Dialog). Popover / Tooltip / Menu / Drawer follow on the
same core.
import { Component } from '@angular/core';
import { createOverlayControllerBinding } from '@bimetal/angular';
import { DialogComponent } from '@bimetal/overlay-angular-components';
import '@bimetal/overlay-angular-components/styles';
@Component({
selector: 'app-example',
standalone: true,
imports: [DialogComponent],
template: `
<button (click)="ctrl.open()">Open</button>
<bm-dialog [controller]="ctrl" title="Hello">…content…</bm-dialog>
`,
})
export class ExampleComponent {
readonly ctrl = createOverlayControllerBinding({ config: { closeOnBackdrop: false } }).ctrl;
}The controller owns open/close + the dismiss policy; the component renders the modal DOM
(portalled to body), traps focus (FocusTrapDirective over @bimetal/a11y-dom), locks
body scroll (ref-counted, stack-safe) and feeds Esc / backdrop / close-button dismissals
back through requestClose. A changed policy goes in through ctrl.setConfig(…). Styles
come from @bimetal/overlay-themes (re-exported). Apache-2.0.
