TwitterGithub

Dialog

A window overlaid on either the primary window or another dialog window, rendering the content underneath inert.

Installation

npx nx g @spartan-ng/nx:ui dialog

Usage

import {
  BrnDialogCloseDirective,
  BrnDialogComponent,
  BrnDialogContentDirective,
  BrnDialogDescriptionDirective,
  BrnDialogOverlayComponent,
  BrnDialogTitleDirective,
  BrnDialogTriggerDirective,
} from '@spartan-ng/ui-dialog-brain';
import {
  HlmDialogCloseDirective,
  HlmDialogContentDirective,
  HlmDialogDescriptionDirective,
  HlmDialogFooterComponent,
  HlmDialogHeaderComponent,
  HlmDialogOverlayDirective,
  HlmDialogTitleDirective,
} from '@spartan-ng/ui-dialog-helm';
<brn-dialog closeDelay="100">
  <brn-dialog-overlay hlm />
  <button brnDialogTrigger hlmBtn>Edit Profile</button>
  <div hlmDialogContent *brnDialogContent="let ctx">
    <hlm-dialog-header>
      <h3 brnDialogTitle hlm>Edit profile</h3>
      <p brnDialogDescription hlm>Make changes to your profile here. Click save when you're done.</p>
    </hlm-dialog-header>
    <hlm-dialog-footer>
      <button hlmBtn type="submit">Save changes</button>
    </hlm-dialog-footer>
    <button brnDialogClose hlm>
      <span class="sr-only">Close</span>
      <hlm-icon class="flex h-4 w-4" size="100%" name="radixCross1" />
    </button>
  </div>
</brn-dialog>

Inside Menu

You can nest dialogs inside context or dropdown menus. Make sure to wrap the menu-item inside the brn-dialog component and apply the BrnDialogTrigger directive. Another option is to use the brnDialogTriggerFor alternative, which takes in a reference to the brn-dialog. That way you can avoid nesting the template.

Right click here
Dropdown Menu Context Menu