Skip to content
This repository was archived by the owner on May 15, 2023. It is now read-only.

A container that allows any of its nested children to be swiped away.

Notifications You must be signed in to change notification settings

PolymerElements/iron-swipeable-container

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Sep 14, 2018
ac02c69 · Sep 14, 2018

History

97 Commits
Aug 23, 2018
Jul 12, 2018
Jul 12, 2018
Aug 16, 2018
Aug 16, 2018
Sep 7, 2018
May 17, 2016
Jul 12, 2018
Sep 14, 2018
Aug 8, 2018
Jul 12, 2018
Jun 23, 2018
Sep 14, 2018
Sep 14, 2018
Jun 5, 2018

Repository files navigation

Published on NPM Build status Published on webcomponents.org

<iron-swipeable-container>

<iron-swipeable-container> is a container that allows any of its nested children (native or custom elements) to be swiped away. By default it supports a curved or horizontal transition, but the transition duration and properties can be customized.

See: Documentation, Demo.

Usage

Installation

npm install --save @polymer/iron-swipeable-container

In an html file

<html>
  <head>
    <script type="module">
      import '@polymer/iron-swipeable-container/iron-swipeable-container.js';
    </script>
  </head>
  <body>
    <iron-swipeable-container>
      <div>I can be swiped</div>
      <paper-card heading="Me too!"></paper-card>
    </iron-swipeable-container>
  </body>
</html>

In a Polymer 3 element

import {PolymerElement, html} from '@polymer/polymer';
import '@polymer/iron-swipeable-container/iron-swipeable-container.js';

class SampleElement extends PolymerElement {
  static get template() {
    return html`
    <iron-swipeable-container>
      <div>I can be swiped</div>
      <paper-card heading="Me too!"></paper-card>
    </iron-swipeable-container>
    `;
  }
}
customElements.define('sample-element', SampleElement);

Contributing

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

Installation

git clone https://github.com/PolymerElements/iron-swipeable-container
cd iron-swipeable-container
npm install
npm install -g polymer-cli

Running the demo locally

polymer serve --npm
open http://127.0.0.1:<port>/demo/

Running the tests

polymer test --npm