- React Component
- Developed to be used as a Infinite Carousel but can be used also with limited resources
- Handles the pagination requests for you
- Dependencies free (only React)
- Allow you to render slides as you wish
- Ensures a good performance
- Prepared for mobile and desktop
- TypeScript declarations included
- Customizable
Demo here
fetchStep
: Number of items requested in each GET call (optional, default is 3)hideIndex
: Avoid displaying the index on top right corner (optional, default is false)showArrows
: Show arrows (optional, default is false). Passing therenderArrow
prop also makes the arrows to render.renderBadge
: Render the badge component as you wish. (optional)renderArrow
: Render the arrow component as you wish. (optional, see example)renderItem
: Render each slide as you wish!getData
: Async function that should return the fetched items. Should respect the following format:
{ offset: number; total: number; items: { id }[] }
const getData = async ({ offset, limit }) => {
const url = `http://someApi.com?offset=${offset}&limit=${limit}`;
const { data } = await (await fetch(url)).json();
return {
offset: data.offset,
total,
items: data.results.map(item => ({...item, id: item.name })),
};
};
yarn
on root folder
yarn start:dev
oryarn start
yarn build
oryarn build:dev
Contributions are welcome. Just open a PR and feel free to contact me :-).
You can also start looking into ope issues, specially the ones with good first issue
label.
- Storybook (soon)