react-kinda-slider
v0.0.5
Published
React kinda slider
Downloads
4
Readme
Kinda React slider
Draft, not optimized yet
Usage
import React from 'react';
import Carousel from 'react-kinda-slider';
const Cards = ({ items = [] }) => {
return (
<Carousel
infinite
draggable
withControls
items={items}
renderItem={(item, index, realIndex) => (
<div className='card' key={realIndex}>
<h3>{item.title}</h3>
<p>{item.text}</p>
</div>
)}
renderControl={({ canUse, onUse, type }) => (
<button onClick={onUse} disabled={canUse}>
{type === 'forward' ? '>' : '<'}
</button>
)}
/>
);
};
Goals
- infinite mode for "targetIndex" prop update
- optimization (memoize calculations)
- refactoring
- unit-tests