paper-dialog | Vaadin

A Material Design dialog

Published on NPM Build status Published on


<paper-dialog> is a dialog with Material Design styling and optional animations when it is opened or closed. It provides styles for a header, content area, and an action area for buttons. You can use the <paper-dialog-scrollable> element (in its own repository) if you need a scrolling content area. To autofocus a specific child element after opening the dialog, give it the autofocus attribute. See PaperDialogBehavior and IronOverlayBehavior for specifics.

For example, the following code implements a dialog with a header, scrolling content area and buttons. Focus will be given to the dialog-confirm button when the dialog is opened.

    Lorem ipsum...
  <div class="buttons">
    <paper-button dialog-dismiss>Cancel</paper-button>
    <paper-button dialog-confirm autofocus>Accept</paper-button>


See the docs for PaperDialogBehavior for the custom properties available for styling this element.


Set the entry-animation and/or exit-animation attributes to add an animation when the dialog is opened or closed. See the documentation in PolymerElements/neon-animation for more info.

For example:

<script type="module">
  import '@polymer/neon-animation/animations/scale-up-animation.js';
  import '@polymer/neon-animation/animations/fade-out-animation.js';

<paper-dialog entry-animation="scale-up-animation"
  <div>Dialog body</div>


See the docs for PaperDialogBehavior for accessibility features implemented by this element.

See: Documentation, Demo.



npm install --save @polymer/paper-dialog

In an html file

    <script type="module">
      import '@polymer/paper-dialog/paper-dialog.js';

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/paper-dialog/paper-dialog.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
customElements.define('sample-element', SampleElement);


If you want to send a PR to this element, here are the instructions for running the tests and demo locally:


git clone
cd paper-dialog
npm install
npm install -g polymer-cli

Running the demo locally

polymer serve --npm

Running the tests

polymer test --npm


Link to this version
ImportedReleased 10 March 2018Other
Framework Support
Polymer 2.0+
Also supported:
Polymer 1 (3.0.1)Polymer 3 (3.0.1)
Browser Compatibility
Install with
bower install --save PolymerElements/paper-dialog"#2.1.1"
Run the above Bower command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 2.1.1


  • neon-animation#PolymerElements/neon-animation#1 - 2
  • paper-dialog-behavior#PolymerElements/paper-dialog-behavior#1 - 2
  • iron-overlay-behavior#PolymerElements/iron-overlay-behavior#1 - 2
  • polymer#Polymer/polymer#1.9 - 2