{"id":27966676,"url":"https://github.com/a7alabs/react-whirlpool","last_synced_at":"2025-05-07T20:55:54.970Z","repository":{"id":64017767,"uuid":"572619776","full_name":"A7ALABS/react-whirlpool","owner":"A7ALABS","description":"Dead easy carousel for reactjs and nextjs with built-in typescript support","archived":false,"fork":false,"pushed_at":"2024-03-25T07:22:11.000Z","size":3100,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T20:55:45.141Z","etag":null,"topics":["carousel-component","nextjs","react"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/A7ALABS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-30T17:00:41.000Z","updated_at":"2023-11-24T13:26:56.000Z","dependencies_parsed_at":"2023-01-24T22:00:11.866Z","dependency_job_id":"8aae8051-8b6f-4400-ba38-ec27075a01c6","html_url":"https://github.com/A7ALABS/react-whirlpool","commit_stats":{"total_commits":21,"total_committers":3,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"c8564237a717a25c88986d94903d5f4b5b0ccda8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A7ALABS%2Freact-whirlpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A7ALABS%2Freact-whirlpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A7ALABS%2Freact-whirlpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/A7ALABS%2Freact-whirlpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/A7ALABS","download_url":"https://codeload.github.com/A7ALABS/react-whirlpool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954375,"owners_count":21830902,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carousel-component","nextjs","react"],"created_at":"2025-05-07T20:55:54.245Z","updated_at":"2025-05-07T20:55:54.963Z","avatar_url":"https://github.com/A7ALABS.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Whirlpool Carousel \r\n\r\nhttps://github.com/A7ALABS/react-whirlpool/assets/60537632/0e27a034-7582-431d-95b3-263f224c9048\r\n\r\n\r\nhttps://github.com/A7ALABS/react-whirlpool/assets/60537632/d5f3ba93-56ca-4ff5-8467-dc10b4f72be2\r\n\r\n\r\n**Features**\r\n* Responsive\r\n* Customize previous and next buttons\r\n* Bi-directional - horizontal and vertical\r\n* Auto play\r\n\r\n## Installing\r\n`yarn add react-whirlpool`\r\n\r\n## Important\r\nMake sure to import the css file with `import 'react-whirlpool/dist/cjs/component/SimpleCarousel.css'`\r\n\r\n## Usage\r\n```\r\nimport React, { useRef, useState } from \"react\";\r\nimport { SimpleCarousel } from \"react-whirlpool\";\r\nimport 'react-whirlpool/dist/cjs/component/SimpleCarousel.css' // =\u003e important\r\n\r\nfunction App() {\r\n  const [list, setList] = useState([\"A\", \"B\", \"C\", \"D\", \"E\"]);\r\n  const simpleCarouselRef = useRef\u003cany\u003e();\r\n  const [activeIndex, setActiveIndex] = useState(0);\r\n\r\n  return (\r\n    \u003cdiv \u003e\r\n      \u003cSimpleCarousel\r\n        isHorizontal={true}\r\n        gap={20}\r\n        autoPlay={false}\r\n        minHeight=\"254px\"\r\n        ref={simpleCarouselRef}\r\n        hideArrows={true}\r\n        onActiveIndexUpdate={(index: number) =\u003e setActiveIndex(index)}\r\n      \u003e\r\n        {list.map((item: string, key) =\u003e (\r\n          \u003cdiv key={key}\u003e\r\n            {item}\r\n          \u003c/div\u003e\r\n        ))}\r\n      \u003c/SimpleCarousel\u003e\r\n      //custom prev and next buttons\r\n      \u003cbutton\r\n        onClick={() =\u003e {\r\n          simpleCarouselRef.current \u0026\u0026\r\n            simpleCarouselRef.current.handlePrevEvent();\r\n        }}\r\n      \u003e\r\n        Prev\r\n      \u003c/button\u003e\r\n      \u003cbutton\r\n        onClick={() =\u003e {\r\n          simpleCarouselRef.current \u0026\u0026\r\n            simpleCarouselRef.current.handleNextEvent();\r\n        }}\r\n      \u003e\r\n        Next\r\n      \u003c/button\u003e\r\n    \u003c/div\u003e\r\n  );\r\n}\r\n\r\nexport default App;\r\n```\r\n\r\n## Props\r\n| Name              | Value                                                               | Description                                                                                       |\r\n|-------------------| ------------------------------------------------------------------  | -------------------------------------------------------------------------------------------------------------------------------------------     |\r\n| isHorizontal      | boolean  | Define the direction of the slider, defaults to 'horizontal'.    |\r\n|  children         | JSX Element | Pass any number of JSX elements (carousel cards) which are to be rendered in the carousel  |\r\n| gap               | number | Define gap (in px) between two carousel cards  |\r\n| minHeight         | string, optional | Define the minimum height of the carousel container  |\r\n|minWidth           | string, optional  | Define the minimum width of the carousel container  |\r\n|onActiveIndexUpdate| function, optional | Takes an active index (number) as argument to update selected index in SimpleCarousel |\r\n| autoplay          | boolean, default false, optional  | Enable auto rotation of carousel, rotation interval is set to 3000ms    |\r\n| autoPlayInterval  | number, default 3000, optional   | Auto-play interval in milliseconds\r\n hideArrows         | boolean, default true, optional  | Hide default arrows    |\r\n hideDevPanel       | boolean, default true, optional | Hide dev panel  |\r\n hideInitGap        | boolean, default true, optional | Hide initial gap between the first card and carousel container  |\r\n ref                | any, optional   | Create and pass reference to access the handler methods - 1. handlePrevEvent() to handle previous button clicking event and 2. handleNextEvent() to handle next button clicking event |\r\n\r\n ## Common Issues\r\n 1. `CJS WARNING - Failed to parse source map` =\u003e **Workaround** - [Link](https://github.com/facebook/create-react-app/discussions/11767#discussioncomment-2092902)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7alabs%2Freact-whirlpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa7alabs%2Freact-whirlpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa7alabs%2Freact-whirlpool/lists"}