0.0.15 • Published 5 years ago

@alphasquad/horizontal-scroll-view v0.0.15

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Available Scripts

Horizontal scroll view. Ability to scroll on drag.

npm i @alphasquad/horizontal-scroll-view

OR

yarn add @alphasquad/horizontal-scroll-view

Demo

npm.io

How to use?

import Horizontal from "@alphasquad/horizontal-scroll-view";

<Horizontal
            data={data} // Array of object
            Component={Item} // Component that is going to be rendered and recieve object from above array
            wrapperClass="customClass"
            scrollLength={100} // How much the scroll should jump on left or right contorl click
            showControls={true}

        />

Item Component

const Item: React.FC<InnerProps> = (props) => {
    let { item } = props;
    return <div className="contentWrapper">
      <img src={item.image} alt=""/>
      <h1>{item.title}</h1>
      <p>{item.content}</p>
    </div>
  };

Props

PropsTypesDescriptionRequiredDefault
dataarrayArray of object on which the loop will be applied and individual object will be returned to Componenttruefalse
ComponentComponentThe component on which the loop will be applied and and single object will be passed as props to this componenttruefalse
wrapperClassstringclass will be applied on the wrapping divfalse-
scrollLengthnumberHow much the scroll should jump on left or right contorl clickfalse40
showControlsboolShow/hide left right arrowsfalsefalse
0.0.14

5 years ago

0.0.15

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago