1.0.4 • Published 4 years ago

card-scroller v1.0.4

Weekly downloads
14
License
ISC
Repository
-
Last release
4 years ago

Card Scroller

npm GitHub stars

Twitter Follow

a light-weight React full screen Card Scroller Component.

npm.io

Installation

npm i card-scroller

Usage

import CardScroller from '../src/index'
import Img from './test.png'

const CardList = [{...},{...},{...}] //{...} is CardObject

const MyCard = () => {
    <CardScroller CardList={CardList}/>
}

API

paramdetailtyperequire*
CardListcard object list (only static card)CardObject true

CardList - Example

const CardList = [{...},{...},{...}]

const MyCard = () => {
    <CardScroller CardList={CardList}/>
}

CardObject

paramdetailtyperequire*
imgcard image which always displayobjecttrue
categorycard category of the detailstringtrue
summarysummary of the cardstringtrue
dateAndAuthorthe detail of this card's creationstringtrue
onClickonClick Event handlerfunctionfalse
activeBackgroundColoractive background color when mouse over itstringtrue

CardObject - Example

{
    img:Img,
    category:"ANDROID",
    summary:"Bringing more people online and introducing Camera Go",
    dateAndAuthor:"By Arpit Midha & Joris van Mens - Mar 19,2020",
    onClick:function(){
        console.log("Do something")
    },
    activeBackgroundColor:"#00e5ff"
}