2.1.1 • Published 1 year ago

svelte-liquid-swipe v2.1.1

Weekly downloads
-
License
-
Repository
github
Last release
1 year ago

Usage

Install with

npm i -D svelte-liquid-swipe

Import your LiquidContainer component

<script>
  import { LiquidContainer } from 'svelte-liquid-swipe'
</script>

<LiquidContainer />

The LiquidContainer component exposes a root element of position:absolute, meaning you'll have to wrap it inside your own relative, fixed, etc element in order to manage its size and position.

Something like this

<script>
  import { LiquidContainer } from 'svelte-liquid-swipe'
</script>

<div style="position:relative;width:600px;height:800px;overflow:hidden">
  <LiquidContainer />
</div>

Then add some components to your container

<script>
  import { LiquidContainer } from 'svelte-liquid-swipe'
  import Page1 from 'page1.svelte'
  import Page2 from 'page2.svelte'
  import Page3 from 'page3.svelte'
  import Page4 from 'page4.svelte'

  const pages = [Page1, Page2, Page3, Page4]
</script>

<div style="position:relative;width:600px;height:800px;overflow:hidden">
  <LiquidContainer direction="right" components="{pages}" />
</div>

Result

Make sure you set overflow:hidden on your wrapper for the best results.

Notes

Looking for full project example? Checkout the example branch.

2.1.1

1 year ago

2.1.0

1 year ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.1

2 years ago