svelte-horizontal-scroller

Svelte Horizontal Scroller

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

svelte-horizontal-scroller

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

Support for mobile touch and cursor drag & drop.

Demo

LIVE DEMO

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

Top categories

Loading Svelte Themes