Cards Carousel
React.js
medium
30 mins
Build a card carousel component that displays one card at a time with navigation buttons ("Previous" and "Next") to scroll through a list of cards.
Requirements
- The component accepts a prop
cards(an array of objects withtitleanddescription). - Initially shows the first card with title and description.
- Clicking "Next" shows the next card, and "Previous" shows the previous one.
- Buttons should be disabled appropriately at the start/end of the list.
- Display the card number like “1 of 5”.
Constraints & Edge Cases
- If
cardsarray is empty, show "No cards available". - Buttons must be disabled when there's no next or previous card.
- Should handle single-card array gracefully.
Reference UI

Preview what you need to build
Companies:
apple
netflix
adobe
snapchat
Solve Similar questions 🔥
Want to upskill? Explore our courses!
Namaste DSA
Master DSA from scratch with numerous problems, and expert guidance.
Namaste React
Wanna dive deep into React and become Frontend Expert? Learn with me now!
Namaste Frontend System Design
The most comprehensive and detailed course for frontend system design.
Namaste Node.js
Wanna dive deep into Node.js? Enroll into `Namaste Node.js` now!
