react-horizontal-switch-scroll
v1.1.9
Published
Horizontal carousel scrollable with left/right buttons
Downloads
29
Readme
Quick start guide
Installing react-horizontal-switch-scroll
$ npm install --save react-horizontal-switch-scroll
Usage
import { SwitchCarousel } from 'react-horizontal-switch-scroll'
const data = [
{
name: "home"
url: "/"
},
{
name: "about"
url: "/about.html"
},
{
name: "contact"
url: "/contact.html"
}
]
const list = (data) => {
const list_elements = data.map((elem, index) => {
return (
<a href={elem.url}>{elem.name}</a>
)
});
return list_elements;
}
.....
class React-Component extends React.Component {
......
render() {
return (
.....
<SwitchCarousel
list={list(data)}
width={250}
leftButton={<ArrowLeft> < </ArrowLeft>}
rightButton={<ArrowRight> > </ArrowRight>}
/>