npm.io
1.0.1 • Published 5 years ago

svelte-horizontal-scroller

Licence
MIT
Version
1.0.1
Deps
0
Size
41 kB
Vulns
0
Weekly
0
Stars
2

svelte-horizontal-scroller

npm NPM

A pretty straightforward, simple, and unstyled Horizontal Scroller for Svelte.

Support for mobile touch and cursor drag & drop.

Demo

LIVE DEMO

DragAndDrop

How to install

npm install svelte-horizontal-scroller

How to use it

<script>
    import HorizontalScroller from "svelte-horizontal-scroller"
</script>

<HorizontalScroller>
    Add your items here
</HorizontalScroller>

Styling

This component has almost no styles on it (beyond those necessary for its functionality), but you can change the padding, width, and default item gaps declaring the following variables on your global css:

Variable Default Value
--horizontal-scroller-width auto
--horizontal-scroller-padding 1em
--horizontal-scroller-gap 1em