Your search did not match any results.
Dialogs and Notifications

Overview

DevExtreme HTML5 JavaScript Dialog and Notification Widgets are adaptive Angular components that help a user interact with your application. They provide intuitive UI, adaptive design, and customization flexibility. Available as Angular components, these widgets support native Angular features: AOT compilation, declarative configuration, TypeScript compile-time checking, and more.

Copy to CodeSandBox
Apply
Reset
<div class="images"> <div *ngFor="let house of houses"> <div (click)="showHouse(house)" class="item-content"> <img src="{{house.Image}}" /> <div class="item-options"> <div> <div class="address">{{house.Address}}</div> <div class="price large-text">{{house.Price | currency:'USD':'symbol':'1.0-0'}}</div> <div class="agent"> <div id="house{{house.ID}}"> <img src="../../../../images/icon-agent.svg"> Listing agent </div> </div> </div> </div> <dx-popover target="#house{{house.ID}}" showEvent="mouseenter" hideEvent="mouseleave" contentTemplate="popoverContent" [width]="260"> <dxo-position at="bottom" my="top" offset="0 2" collision="fit flip"> </dxo-position> <div *dxTemplate="let data of 'popoverContent'"> <div class="agent-details"> <img src="{{house.Agent.Picture}}" /> <div> <div class="name large-text">{{house.Agent.Name}}</div> <div class="phone">Tel: {{house.Agent.Phone}}</div> </div> </div> </div> </dx-popover> </div> </div> <dx-popup [width]="660" [height]="540" [showTitle]="true" [title]="currentHouse.Address" [dragEnabled]="false" [closeOnOutsideClick]="true" [(visible)]="popupVisible"> <div *dxTemplate="let data of 'content'"> <div class='popup-property-details'> <div class='large-text'>{{currentHouse.Price | currency:'USD':'symbol':'1.0-0'}}</div> <div class='opacity'>{{currentHouse.Address}}, {{currentHouse.City}}, {{currentHouse.State}}</div> <dx-button class="favorites" [text]="currentHouse.Favorite ? REMOVE_FROM_FAVORITES : ADD_TO_FAVORITES" icon="favorites" [width]="260" [height]="44" (onClick)="changeFavoriteState($event)"> </dx-button> <div class='images'> <img src="{{currentHouse.Image}}" /> <img src="{{currentHouse.Image.replace('.jpg', 'b.jpg')}}" /> </div> <div>{{currentHouse.Features}}</div> </div> </div> </dx-popup> </div>
import { NgModule, Component, enableProdMode } from '@angular/core'; import { DecimalPipe } from '@angular/common'; import { BrowserModule } from '@angular/platform-browser'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { DxTemplateModule, DxButtonModule, DxPopupModule, DxPopoverModule } from 'devextreme-angular'; import notify from 'devextreme/ui/notify'; import { Service, House, Agent } from './app.service'; if(!/localhost/.test(document.location.host)) { enableProdMode(); } @Component({ selector: 'demo-app', templateUrl: 'app/app.component.html', styleUrls: ['app/app.component.css'], providers: [Service] }) export class AppComponent { houses: House[]; currentHouse: House; popupVisible = false; ADD_TO_FAVORITES = "Add to Favorites"; REMOVE_FROM_FAVORITES = "Remove from Favorites"; constructor(service: Service) { this.houses = service.getHouses(); this.currentHouse = this.houses[0]; } showHouse(house: House) { this.currentHouse = house; this.popupVisible = true; } changeFavoriteState() { let favoriteState = !this.currentHouse.Favorite; let message = "This item has been " + (favoriteState ? "added to" : "removed from") + " the Favorites list!"; this.currentHouse.Favorite = favoriteState; notify({ message: message, width: 450 }, favoriteState ? "success" : "error", 2000); } } @NgModule({ imports: [ BrowserModule, DxTemplateModule, DxButtonModule, DxPopupModule, DxPopoverModule ], declarations: [AppComponent], bootstrap: [AppComponent] }) export class AppModule { } platformBrowserDynamic().bootstrapModule(AppModule);
::ng-deep .large-text { font-size: 24px; color: #ff6a50; } ::ng-deep .opacity { opacity: 0.5; } ::ng-deep .images { font-size: 0; } ::ng-deep .images > div { display: inline-block; width: 33.3%; vertical-align: top; } ::ng-deep .images .item-content { position: relative; margin: 5px; color: #fff; cursor: pointer; } ::ng-deep .images .item-content > img { width: 100%; } ::ng-deep .item-content .item-options { position: absolute; top: 0; left: 0; height: 100%; width: 100%; } ::ng-deep .images .item-content:hover > .item-options { box-shadow: inset 0 0 0 2px #f05b41; } ::ng-deep .item-content .item-options > div { position: absolute; bottom: 0; width: 100%; height: 64px; padding-top: 4px; background-color: rgba(19,32,51,0.8); z-index: 1; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; border-left: 2px solid transparent; border-right: 2px solid transparent; } ::ng-deep .images .item-content:hover > .item-options > div { border-bottom: 2px solid #f05b41; border-left: 2px solid #f05b41; border-right: 2px solid #f05b41; } ::ng-deep .item-content .item-options .address, ::ng-deep .item-content .item-options .price { max-width: 70%; padding-left: 8px; } ::ng-deep .item-content .item-options .address { font-size: 14px; } ::ng-deep .item-content .item-options .agent { font-size: 12px; width: 60px; position: absolute; right: -2px; top: 0; bottom: 0; text-align: center; border-left: 1px solid rgba(255, 255, 255, 0.4); line-height: 13px; } ::ng-deep .item-content .item-options .agent > div:hover { color: #f05b41; } ::ng-deep .item-content .item-options .agent img { display: block; width: 13px; height: 16px; margin: 8px auto 2px; } ::ng-deep .agent-details > img, .agent-details > div { display: inline-block; vertical-align: top; line-height: 26px; } ::ng-deep .agent-details > img { width: 40px; margin-right: 10px; } ::ng-deep .agent-details .phone { font-size: 18px; } ::ng-deep .popup-property-details { overflow: hidden; position: relative; } ::ng-deep .popup-property-details .images { width: 700px; } ::ng-deep .popup-property-details img { height: 205px; margin: 10px 10px 10px 0; } ::ng-deep .dx-button.favorites { background-color: #f05b41; color: #fff; position: absolute; top: 5px; right: 0; } ::ng-deep .dx-button.favorites .dx-icon { color: #fff; }
import { Injectable } from '@angular/core'; export class Agent { ID: number; Name: string; Phone: string; Picture: string; } export class House { ID: number; Address: string; City: string; State: string; ZipCode: string; Price: number; Image: string; Features: string; Favorite?: boolean; Agent: Agent; } let houses: House[] = [{ ID: 1, Favorite: false, Address: "652 Avonwick Gate", City: "Toronto", State: "ON", ZipCode: "M3A25", Price: 780000, Image: "../../../../images/gallery/1.jpg", Features: "Dishwasher, Disposal, Separate laundry room, 3/4 bath downstairs, Formal dining room, Downstairs family room, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Granite countertops in kitchen, Hardwood flooring in kitchen, Kitchen island, Solid surface countertops in kitchen, Entry foyer, Front living room, Ceiling fan in master bedroom, Master bedroom separate from other, Mirrored door closet in master bedroom, 2nd bedroom: 11x13, 3rd bedroom: 11x14, 4th Bedroom: 18x13, Alarm system owned, Built-in microwave, Carpet, Ceiling fan(s), Convection oven, Double built-in gas ovens, Gas cooktop, Gas stove, Marble/Stone floors", Agent: { ID: 1, Name: "John Heart", Phone: "(213) 555-9392", Picture: "../../../../images/employees/01.png" } }, { ID: 2, Favorite: false, Address: "82649 Topeka St", City: "Riverbank", State: "CA", ZipCode: "95360", Price: 1750000, Image: "../../../../images/gallery/2.jpg", Features: "Dishwasher, Disposal, Separate laundry room, Full bath downstairs, Formal dining room, Downstairs family room, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Granite countertops in kitchen, Kitchen custom cabinets, Kitchen island, Pantry, Walk-in pantry, Entry foyer, Formal living room, Rear living room, Vaulted ceiling in living room, Balcony in master bedroom, Master bedroom separate from other, Master bedroom upstairs, Sitting room in master bedroom, Walk-in closet in master bedroom, 2nd bedroom: 13X20, 3rd bedroom: 13X17, 4th Bedroom: 13X18, 5th Bedroom: 14X16, Alarm system owned, Blinds, Built-in electric oven, Built-in microwave, Carpet, Ceiling fan(s), Gas cooktop, Intercom system, Marble/Stone floors, Water conditioner owned, Water filtering system, Window Coverings Throughout", Agent: { ID: 2, Name: "Olivia Peyton", Phone: "(310) 555-2728", Picture: "../../../../images/employees/09.png" } }, { ID: 3, Favorite: false, Address: "328 S Kerema Ave", City: "Milford", State: "CT", ZipCode: "06465", Price: 350000, Image: "../../../../images/gallery/3.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Washer/Dryer on 2nd floor, Full bath downstairs, Formal dining room, Downstairs family room, Separate family room, Wet bar in family room, Breakfast nook (eating area), Garden window in kitchen, Granite countertops in kitchen, Kitchen island, Marble/Stone flooring in kitchen, Pantry, Formal living room, Front living room, Master bedroom separate from other, Master bedroom upstairs, Sitting room in master bedroom, Walk-in closet in master bedroom, 2nd bedroom: 16x12, 3rd bedroom: 13x16, 4th Bedroom: 18x12, Alarm system owned, Built-in microwave, Carpet, Ceiling fan(s), Double built-in electric ovens, Gas cooktop, Marble/Stone floors", Agent: { ID: 3, Name: "Robert Reagan", Phone: "(818) 555-2387", Picture: "../../../../images/employees/03.png" } }, { ID: 4, Favorite: false, Address: "5119 Beryl Dr", City: "San Antonio", State: "TX", ZipCode: "78212", Price: 455000, Image: "../../../../images/gallery/4.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Full bath downstairs, Living/Dining room combo, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Granite countertops in kitchen, Kitchen custom cabinets, Kitchen island, Recessed lighting in kitchen, Tile flooring in kitchen, Walk-in pantry, Formal living room, Front living room, Ceiling fan in master bedroom, Master bedroom downstairs, Walk-in closet in master bedroom, 2nd bedroom: 15x13, 3rd bedroom: 12x12, 4th Bedroom: 14x12, Alarm system owned, Blinds, Built-in microwave, Carpet, Ceiling fan(s), Central vacuum, Convection oven, Double built-in electric ovens, Electric cooktop, Intercom system, Tile floors", Agent: { ID: 4, Name: "Greta Sims", Phone: "(818) 555-6546", Picture: "../../../../images/employees/04.png" } }, { ID: 5, Favorite: false, Address: "61207 16th St N", City: "Moorhead", State: "MN", ZipCode: "56564", Price: 1700000, Image: "../../../../images/gallery/5.jpg", Features: "Dishwasher, Disposal, Separate laundry room, Washer/Dryer on 1st floor, Full bath downstairs, Formal dining room, Downstairs family room, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Granite countertops in kitchen, Kitchen custom cabinets, Kitchen island, Formal living room, Rear living room, Sunken living room, Vaulted ceiling in living room, Balcony in master bedroom, Ceiling fan in master bedroom, Master bedroom separate from other, Master bedroom upstairs, Walk-in closet in master bedroom, 2nd bedroom: 16X17, 3rd bedroom: 14X16, 4th Bedroom: 13X13, 5th Bedroom: 12X12, Blinds, Built-in microwave, Carpet, Ceiling fan(s), Central vacuum, Double built-in electric ovens, Gas cooktop, Marble/Stone floors, Pot shelves, Water conditioner owned, Water filtering system, Window Coverings Throughout", Agent: { ID: 1, Name: "John Heart", Phone: "(213) 555-9392", Picture: "../../../../images/employees/01.png" } }, { ID: 6, Favorite: false, Address: "8512 Tanglewood Cir", City: "Reform", State: "AL", ZipCode: "35487", Price: 250000, Image: "../../../../images/gallery/6.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Full bath downstairs, Formal dining room, Built-in bookcases in family room, Downstairs family room, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Granite countertops in kitchen, Kitchen custom cabinets, Kitchen island, Marble/Stone flooring in kitchen, Pantry, Formal living room, Front living room, Ceiling fan in master bedroom, Master bedroom downstairs, Master bedroom separate from other, Sitting room in master bedroom, Walk-in closet in master bedroom, 2nd bedroom: 11X15, 3rd bedroom: 11X14, Alarm system owned, Blinds, Built-in microwave, Carpet, Ceiling fan(s), Double built-in electric ovens, Drapes, Electric cooktop, Marble/Stone floors, Window Coverings Throughout, Wine refrigerator", Agent: { ID: 2, Name: "Olivia Peyton", Phone: "(310) 555-2728", Picture: "../../../../images/employees/09.png" } }, { ID: 7, Favorite: false, Address: "7121 Bailey St", City: "Worcester", State: "MA", ZipCode: "01605", Price: 555000, Image: "../../../../images/gallery/7.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Washer/Dryer on 1st floor, Full bath downstairs, Formal dining room, Downstairs family room, Separate family room, Breakfast Bar/Counter, Breakfast nook (eating area), Kitchen island, Recessed lighting in kitchen, Tile countertops in kitchen, Walk-in pantry, Entry foyer, Formal living room, Front living room, Dressing room in master bedroom, Master bedroom separate from other, Master bedroom upstairs, Walk-in closet in master bedroom, 2nd bedroom: 14x16, 3rd bedroom: 12x13, 4th Bedroom: 13x14, Carpet, Double built-in electric ovens, Drywall, Gas cooktop, Manmade wood or laminate floors, Marble/Stone floors, Water conditioner loope", Agent: { ID: 3, Name: "Robert Reagan", Phone: "(818) 555-2387", Picture: "../../../../images/employees/03.png" } }, { ID: 8, Favorite: false, Address: "620201 Plymouth Rd", City: "Detroit", State: "MI", ZipCode: " 48224", Price: 610000, Image: "../../../../images/gallery/8.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Full bath downstairs, Formal dining room, 2+ family rooms, Separate family room, Breakfast nook (eating area), Granite countertops in kitchen, Kitchen custom cabinets, Kitchen island, Walk-in pantry, Entry foyer, Formal living room, Rear living room, Vaulted ceiling in living room, Ceiling fan in master bedroom, Master bedroom downstairs, Walk-in closet in master bedroom, 2nd bedroom: 12x15, 3rd bedroom: 12x15, 4th Bedroom: 12x15, Blinds, Built-in microwave, Carpet, Ceiling fan(s), Electric cooktop, Shutters, Skylight(s), Water conditioner owned, Water filtering system, Window coverings partial", Agent: { ID: 4, Name: "Greta Sims", Phone: "(818) 555-6546", Picture: "../../../../images/employees/04.png" } }, { ID: 9, Favorite: false, Address: "1198 Theresa Cir", City: "Whitinsville", State: "MA", ZipCode: "01582", Price: 320000, Image: "../../../../images/gallery/9.jpg", Features: "Dishwasher, Disposal, Refrigerator, Separate laundry room, Washer/Dryer on 1st floor, 1/2 bath downstairs, Formal dining room, 2+ family rooms, Built-in bookcases in family room, Breakfast Bar/Counter, Granite countertops in kitchen, Kitchen island, Tile flooring in kitchen, Walk-in pantry, Entry foyer, Formal living room, Built-in bookcases in master bedroom, Built-in entertainment center in master bedroom, Ceiling fan in master bedroom, Dressing room in master bedroom, Walk-in closet in master bedroom, 2nd bedroom: 13x12, 3rd bedroom: 12x12, 4th Bedroom: 13x12, Alarm system rented, Blinds, Built-in microwave, Carpet, Ceiling fan(s), Double built-in gas ovens, Tile floors, Window Coverings Throughout", Agent: { ID: 1, Name: "John Heart", Phone: "(213) 555-9392", Picture: "../../../../images/employees/01.png" } } ]; @Injectable() export class Service { getHouses(): House[] { return houses; } }
// In real applications, you should not transpile code in the browser. You can see how to create your own application with Angular and DevExtreme here: // https://github.com/DevExpress/devextreme-angular/blob/master/README.md System.config({ transpiler: 'ts', typescriptOptions: { module: "commonjs", emitDecoratorMetadata: true, experimentalDecorators: true }, meta: { 'typescript': { "exports": "ts" } }, paths: { 'npm:': 'https://unpkg.com/' }, map: { 'ts': 'npm:plugin-typescript@7.0.6/lib/plugin.js', 'typescript': 'npm:typescript@2.2.2/lib/typescript.js', '@angular/core': 'npm:@angular/core@7.1.3/bundles/core.umd.js', '@angular/common': 'npm:@angular/common@7.1.3/bundles/common.umd.js', '@angular/compiler': 'npm:@angular/compiler@7.1.3/bundles/compiler.umd.js', '@angular/platform-browser': 'npm:@angular/platform-browser@7.1.3/bundles/platform-browser.umd.js', '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@7.1.3/bundles/platform-browser-dynamic.umd.js', '@angular/router': 'npm:@angular/router@7.1.3/bundles/router.umd.js', '@angular/forms': 'npm:@angular/forms@7.1.3/bundles/forms.umd.js', '@angular/common/http': 'npm:@angular/common@7.1.3/bundles/common-http.umd.js', 'tslib': 'npm:tslib/tslib.js', 'rxjs': 'npm:rxjs@6.3.3', 'rxjs/operators': 'npm:rxjs@6.3.3/operators', 'devextreme': 'npm:devextreme@19.1', 'jszip': 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.6/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram', 'devextreme-angular': 'npm:devextreme-angular@19.1' }, packages: { 'app': { main: './app.component.ts', defaultExtension: 'ts' }, 'devextreme': { defaultExtension: 'js' }, 'rxjs': { main: 'index.js', defaultExtension: 'js' }, 'rxjs/operators': { main: 'index.js', defaultExtension: 'js' }, 'devextreme-angular': { main: 'index.js', defaultExtension: 'js' } } });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/19.1.3/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/19.1.3/css/dx.light.css" /> <link rel="dx-theme" data-theme="ios7.default" href="https://cdn3.devexpress.com/jslib/19.1.3/css/dx.ios7.default.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/zone.js@0.6.25/dist/zone.js"></script> <script src="https://unpkg.com/reflect-metadata@0.1.3/Reflect.js"></script> <script src="https://unpkg.com/systemjs@0.21.3/dist/system.js"></script> <script src="config.js"></script> <script> System.import('app').catch(console.error.bind(console)); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <demo-app>Loading...</demo-app> </div> </body> </html>