A web component to compare two DOM elements
Usage
npm install --save-dev two-up-element
This appears on one side This appears on the other
Now the user can slide between the two.
API
… …
Attributes
Boolean attribute that enables Edge support. The downside is the elements within the <two-up>
become absolutely positioned. This is because CSS clip
is used rather than clip-path
.
This can also be get/set via the boolean property twoUp.legacyClipCompat
.
…or "vertical"
. The direction the handle moves.
This can also be get/set via the property twoUp.orientation
.
CSS Custom Properties
Demo
TODO.
Files
lib/index.ts
- Original TypeScript.dist/two-up.mjs
- JS module. Default exportsTwoUp
.dist/two-up.js
- Plain JS. ExposesTwoUp
on the global.dist/two-up-min.js
- Minified plain JS. 2.4k gzipped.