<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.
npm install --save @polymer/iron-swipeable-container
<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>
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);
If you want to send a PR to this element, here are the instructions for running the tests and demo locally:
git clone https://github.com/PolymerElements/iron-swipeable-container
cd iron-swipeable-container
npm install
npm install -g polymer-cli
polymer serve --npm
open http://127.0.0.1:<port>/demo/
polymer test --npm