1.0.1 • Published 1 year ago

yah-scroller v1.0.1

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

YAH-Scroller

NPM version npm-typescriptLicense]github-license-url

Yet another horizontal scroller for React. A simple and lightweight component that allows you to scroll horizontally through a list of items on both mobile and desktop with a small 'stretch' effect.

Live Demo ( coming soon )

Example

Installation:

npm install yah-scroller --save-dev

or

yarn add -D yah-scroller

Usage :

Add yah-scroller to your component:

import React from 'react'
import ReactDOM from 'react-dom/client'
import { YahScroller } from 'yah-scroller'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
    <React.StrictMode>
        <div>
            <h2>Simple scroller</h2>
            <YahScroller className="horizontal-scroll">
                <div key={'c1'} className={'category'}>Category 1</div>
                <div key={'c2'} className={'category'}>Category 2</div>
                <div key={'c3'} className={'category'}>Category 3</div>
                <div key={'c4'} className={'category'}>Category 4</div>
                <div key={'c5'} className={'category'}>Category 5</div>
                <div key={'c6'} className={'category'}>Category 6</div>
            </YahScroller>
        </div>
    </React.StrictMode>,
)