BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/@zard/dialog

dialog

zard/dialog
FreeComponent

@zard publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by @zard on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.zardui.com/r/dialog.json

Source

dialog.component.tswww.zardui.com/r/dialog.json · first 6 KB
1import { A11yModule } from '@angular/cdk/a11y';
2import { OverlayModule } from '@angular/cdk/overlay';
3import {
4 BasePortalOutlet,
5 CdkPortalOutlet,
6 type ComponentPortal,
7 PortalModule,
8 type TemplatePortal,
9} from '@angular/cdk/portal';
10import {
11 ChangeDetectionStrategy,
12 Component,
13 type ComponentRef,
14 computed,
15 ElementRef,
16 type EmbeddedViewRef,
17 type EventEmitter,
18 inject,
19 output,
20 type TemplateRef,
21 type Type,
22 viewChild,
23 type ViewContainerRef,
24} from '@angular/core';
25
26import { NgIcon, provideIcons } from '@ng-icons/core';
27import { lucideX } from '@ng-icons/lucide';
28import type { ClassValue } from 'clsx';
29
30import { ZardIdDirective } from '@/shared/core';
31import { mergeClasses, noopFn } from '@/shared/utils/merge-classes';
32
33import type { ZardDialogRef } from './dialog-ref';
34import {
35 dialogDescriptionVariants,
36 dialogFooterVariants,
37 dialogHeaderVariants,
38 dialogTitleVariants,
39 dialogVariants,
40} from './dialog.variants';
41import { ZardButtonComponent } from '../button/button.component';
42
43export type OnClickCallback<T> = (instance: T) => false | void | object;
44export class ZardDialogOptions<T, U> {
45 zCancelIcon?: string;
46 zCancelText?: string | null;
47 zClosable?: boolean;
48 zContent?: string | TemplateRef<T> | Type<T>;
49 zCustomClasses?: ClassValue;
50 zData?: U;
51 zDescription?: string;
52 /** Animation duration (ms) used when closing. Defaults to 100 (matches CSS transition). */
53 zDuration?: number;
54 zHideFooter?: boolean;
55 zMaskClosable?: boolean;
56 zOkDestructive?: boolean;
57 zOkDisabled?: boolean;
58 zOkIcon?: string;
59 zOkText?: string | null;
60 zOnCancel?: EventEmitter<T> | OnClickCallback<T> = noopFn;
61 zOnOk?: EventEmitter<T> | OnClickCallback<T> = noopFn;
62 zTitle?: string | TemplateRef<T>;
63 zViewContainerRef?: ViewContainerRef;
64 zWidth?: string;
65}
66
67@Component({
68 selector: 'z-dialog',
69 imports: [A11yModule, OverlayModule, PortalModule, ZardButtonComponent, ZardIdDirective, NgIcon],
70 template: `
71 <ng-container zardId="z-dialog" #idRef="zardId">
72 @if (config.zClosable || config.zClosable === undefined) {
73 <button
74 type="button"
75 data-testid="z-close-header-button"
76 data-slot="dialog-close"
77 z-button
78 zType="ghost"
79 zSize="icon-sm"
80 class="absolute top-2 right-2"
81 (click)="onCloseClick()"
82 >
83 <ng-icon name="lucideX" class="size-4!" />
84 <span class="sr-only">Close</span>
85 </button>
86 }
87
88// … truncated

What it pulls in

Other registry items

  • button

Files it writes

  • dialog.component.ts
  • dialog.service.ts
  • dialog-ref.ts
  • dialog.variants.ts
  • dialog.imports.ts
  • index.ts

Facts

Registry
@zard
Type
registry:component
Access
Free
Files written
6
Licence
MIT
First indexed
2026-08-09
Last confirmed
today

Go to the source

Docs on @zard www.zardui.com zard-ui/zardui on GitHub Raw registry item This item as JSON

More from @zard

All 49 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
accordionaccordion@zardComponentsFreeno deps · 5 files
alertalert@zardComponentsFreeno deps · 3 files
alert-dialogalert-dialog@zardComponentsFreeno deps · 5 files
avataravatar@zardComponentsFreeno deps · 4 files
badgebadge@zardComponentsFreeno deps · 3 files
breadcrumbbreadcrumb@zardComponentsFreeno deps · 4 files
buttonbutton@zardComponentsFreeno deps · 3 files
button-groupbutton-group@zardComponentsFreeno deps · 3 files
BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studios

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex