Skip to content

muyiwa-felixson/react-horizontal-switch-scroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>}
        />

About

Horizontal carousel scrollable with left/right buttons

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published