Polymer - Iron Swipable Container

The <iron-swipeable-container> is a container that swaps its nested children, i.e. custom or native elements. The default transition is a horizontal or a curve, but you can modify the duration and properties of the transition.

You can disable the swiping using −

  • disable-swipe class − It can be used to disable swiping of a single child.

  • disable-swipe attribute − It can be used to disable swiping of a whole container.


To implement iron-swipeable-container element, navigate to your project folder in the command prompt and use the following command −

bower install PolymerElements/iron-swipable-container --save

The above command installs iron-swipeable-container element in bower_components folder. Then you have to import it in your index.html file as shown in the following command −

<link rel = "import" href = "iron-swipable-container/iron-swipable-container.html">

The following example demonstrates the use of iron-swipeable-container element −

<!DOCTYPE html>
      <base href = https://polygit.org/polymer+1.4.0/components/">
      <script src = webcomponentsjs/webcomponents-lite.min.js"></script>
      <link rel = import" href = polymer/polymer.html">
      <link rel = import" href = iron-swipeable-container/iron-swipeable-container.html">

         .content {
            background-color: LightGrey;
            width: 16%;
            padding: 10px 10px 10px 10px; 

      <h2>Iron-Swipable-Container Example</h2>
         <div class = content">Swipe me left or right</div>


To run the application, navigate to your project directory and run the following command −

polymer serve

Now open the browser and navigate to Following will be the output.

Iron Swipable Container
Kickstart Your Career

Get certified by completing the course

Get Started