Basic
Inject FrModalService and open a dedicated modal component for the common modal composition.
Icons by @ng-icons/tabler-icons
The component library does not provide icons.
Component Blueprint
Dialog primitives powered by Angular CDK with trigger, close, layout, and programmatic opening support.
TS
import { Component, inject } from '@angular/core';
import { FrButtonModule } from '@frame-ui-ng/components/button';
import { FR_MODAL_DATA, FrModalModule, FrModalRef, FrModalService } from '@frame-ui-ng/components/modal';
type SettingsModalData = {
workspace: string;
};
@Component({
selector: 'app-settings-modal',
imports: [FrButtonModule, FrModalModule],
templateUrl: './settings-modal.html',
})
class SettingsModalComponent {
readonly data = inject<SettingsModalData>(FR_MODAL_DATA);
private readonly modalRef = inject(FrModalRef<SettingsModalComponent, 'cancel' | 'saved'>);
close(result: 'cancel' | 'saved'): void {
this.modalRef.close(result);
}
}
readonly modal = inject(FrModalService);
openSettings(): void {
const modalRef = this.modal.open(SettingsModalComponent, {
workspace: 'Platform',
}, {
ariaLabel: 'Workspace settings',
width: '32rem',
});
modalRef.closed.subscribe((result) => {
// handle cancel or saved
});
}HTML
<button frButton type="button" (click)="openSettings()">Open modal</button>HTML
<div frModalPanel>
<div frModalHeader>
<h2 frModalTitle>{{ data.workspace }} settings</h2>
<p frModalDescription>Make focused changes without leaving the current page.</p>
</div>
<div frModalBody>
Modal content goes here.
</div>
<div frModalFooter>
<button frButton appearance="outline" type="button" (click)="close('cancel')">Cancel</button>
<button frButton type="button" (click)="close('saved')">Save changes</button>
</div>
</div>Inject FrModalService and open a dedicated modal component for the common modal composition.
Inject FrModalService to open a modal component with data and dialog config from application logic.
Set showCloseButton to false when users should choose an explicit footer action.
Pass disableClose in the service config when backdrop clicks should be ignored and the modal must be closed through explicit controls.
Enable scrollable and stickyFooter on the panel for longer content while keeping actions visible.
Override modal tokens on a local wrapper when a product flow needs a branded surface, stronger radius, or more prominent elevation without replacing the CDK Dialog foundation.
Hover the modal surface, header, title, description, body, or footer to inspect the tokens that shape the dialog composition.
A composable modal built on top of Angular CDK Dialog.
Use these CSS custom properties to tune the modal surface, backdrop, spacing, radius, shadow, and close affordance.
SCSS
--frame-modal-backdrop-blur: 3px;
--frame-modal-backdrop-bg: rgb(0 0 0 / 0.52);
--frame-modal-bg: var(--frame-background);
--frame-modal-border: var(--frame-border);
--frame-modal-color: var(--frame-foreground);
--frame-modal-muted-color: var(--frame-muted-foreground);
--frame-modal-radius: var(--frame-radius-lg);
--frame-modal-shadow: 0 24px 80px rgb(0 0 0 / 0.18), 0 8px 24px rgb(0 0 0 / 0.12);
--frame-modal-padding: 1.5rem;
--frame-modal-gap: 1rem;
--frame-modal-scrollable-height: min(calc(100dvh - 2rem), 28rem);
--frame-modal-close-bg: transparent;
--frame-modal-close-color: var(--frame-muted-foreground);
--frame-modal-close-hover-bg: var(--frame-muted);
--frame-modal-close-hover-color: var(--frame-foreground);
--frame-modal-z-index: 1000;