yah-scroller
v1.0.1
Published
A simple scroller for React
Downloads
3
Maintainers
Readme
YAH-Scroller
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.
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>,
)