Swipe
Swipeable container that detects pointer and touch drag gestures past a threshold and dispatches a swipe event with direction and distance.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
direction | string | horizontal | Drag axis: horizontal or vertical |
threshold | string | 64 | Trigger/snap distance in px |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/swipe.js"></script> import "./pura/lib/swipe.js";