paper-toggle-button | Vaadin

A Material Design toggle button

Published on NPM Build status Published on


<paper-toggle-button> provides a ON/OFF switch that user can toggle the state by tapping or by dragging the switch.

See: Documentation, Demo.



npm install --save @polymer/paper-toggle-button

In an HTML file

    <script type="module">
      import '@polymer/paper-toggle-button/paper-toggle-button.js';
    <paper-toggle-button checked></paper-toggle-button>
    <paper-toggle-button disabled></paper-toggle-button>

In a Polymer 3 element

import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';

import '@polymer/paper-toggle-button/paper-toggle-button.js';

class ExampleElement extends PolymerElement {
  static get template() {
    return html`
      <paper-toggle-button checked></paper-toggle-button>
      <paper-toggle-button disabled></paper-toggle-button>

customElements.define('example-element', ExampleElement);


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-toggle-button
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-toggle-button"@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/polymer#^3.0.0
  • @polymer/iron-checked-element-behavior#^3.0.0-pre.26
  • @polymer/paper-behaviors#^3.0.0-pre.27
  • @polymer/paper-styles#^3.0.0-pre.26