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 14 September 2018BSD 3-clause "New" or "Revised" License
Framework Support
Polymer 1.0+
Polymer 3.0+
Also supported:
Polymer 2 (2.1.1)
Browser Compatibility
Install with
npm install @polymer/paper-dialog"@3.0.1"
Run the above npm command in your project folder. If you have any issues installing, please contact the author.
Release notes - Version 3.0.1


  • @polymer/neon-animation#^3.0.0-pre.26
  • @polymer/paper-dialog-behavior#^3.0.0-pre.26
  • @polymer/iron-overlay-behavior#^3.0.0-pre.27
  • @polymer/polymer#^3.0.0