Facebook Pixel

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 with title and description).
  • 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 cards array 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

cardsCarousel

Preview what you need to build

Companies:

apple
netflix
adobe
snapchat

Solve Similar questions 🔥

Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.