2.0.1 • Published 8 months ago

svelte-liquid-swipe v2.0.1

Weekly downloads
-
License
-
Repository
github
Last release
8 months 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.0.1

8 months ago

2.0.0

11 months ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.1

1 year ago