React.js Responsive Minimal Carousel

Overview

React Carousel Minimal

npm version

Easy to use, responsive and customizable carousel component for React Projects.

Installation

npm i react-carousel-minimal

Demo Link

Features

  • Responsive
  • Customizable
  • Infinite loop
  • Autoplay with custom duration
  • Supports text caption
  • Pause autoplay on hold with pause icon and customizations
  • Slide number indicators
  • Swipe to go to next slide on touch devices
  • Custom slide background color
  • Thumbnail slide indicators

Usage

import { Carousel } from 'react-carousel-minimal';

function App() {
 const data = [
    {
      image: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/GoldenGateBridge-001.jpg/1200px-GoldenGateBridge-001.jpg",
      caption: "San Francisco"
    },
    {
      image: "https://cdn.britannica.com/s:800x450,c:crop/35/204435-138-2F2B745A/Time-lapse-hyper-lapse-Isle-Skye-Scotland.jpg",
      caption: "Scotland"
    },
    {
      image: "https://static2.tripoto.com/media/filter/tst/img/735873/TripDocument/1537686560_1537686557954.jpg",
      caption: "Darjeeling"
    },
    {
      image: "https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/Palace_of_Fine_Arts_%2816794p%29.jpg/1200px-Palace_of_Fine_Arts_%2816794p%29.jpg",
      caption: "San Francisco"
    },
    {
      image: "https://i.natgeofe.com/n/f7732389-a045-402c-bf39-cb4eda39e786/scotland_travel_4x3.jpg",
      caption: "Scotland"
    },
    {
      image: "https://www.tusktravel.com/blog/wp-content/uploads/2020/07/Best-Time-to-Visit-Darjeeling-for-Honeymoon.jpg",
      caption: "Darjeeling"
    },
    {
      image: "https://www.omm.com/~/media/images/site/locations/san_francisco_780x520px.ashx",
      caption: "San Francisco"
    },
    {
      image: "https://images.ctfassets.net/bth3mlrehms2/6Ypj2Qd3m3jQk6ygmpsNAM/61d2f8cb9f939beed918971b9bc59bcd/Scotland.jpg?w=750&h=422&fl=progressive&q=50&fm=jpg",
      caption: "Scotland"
    },
    {
      image: "https://www.oyorooms.com/travel-guide/wp-content/uploads/2019/02/summer-7.jpg",
      caption: "Darjeeling"
    }
  ];

  const captionStyle = {
    fontSize: '2em',
    fontWeight: 'bold',
  }
  const slideNumberStyle = {
    fontSize: '20px',
    fontWeight: 'bold',
  }
  return (
    <div className="App">
      <div style={{ textAlign: "center" }}>
        <h2>React Carousel Minimal</h2>
        <p>Easy to use, responsive and customizable carousel component for React Projects.</p>
        <div style={{
          padding: "0 20px"
        }}>
          <Carousel
            data={data}
            time={2000}
            width="850px"
            height="500px"
            captionStyle={captionStyle}
            radius="10px"
            slideNumber={true}
            slideNumberStyle={slideNumberStyle}
            captionPosition="bottom"
            automatic={true}
            dots={true}
            pauseIconColor="white"
            pauseIconSize="40px"
            slideBackgroundColor="darkgrey"
            slideImageFit="cover"
            thumbnails={true}
            thumbnailWidth="100px"
            style={{
              textAlign: "center",
              maxWidth: "850px",
              maxHeight: "500px",
              margin: "40px auto",
            }}
          />
        </div>
      </div>
    </div>
  );
}

export default App;

Props

Name Value Description
data array Array of carousel items,
containg JSON elements of the form
{
image: IMAGE_PATH,
caption: TEXT_CAPTION
}
automatic boolean Enable auto play
time number Interval in milliseconds
after which it autmatically goes to
the next slide if automatic is true,
defaults to 2000
width string Width of the Carousel, eg: 600px
height string Width of the Carousel, eg: 400px
slideNumber boolean Enable slide number indicators
captionStyle JSON React style object for the captions
radius string Border radius of the slides, eg: 10px
slideNumberStyle JSON React style object for slide number indicators
captionPosition string Position of the text captions, available options:
top, center, bottom
dots boolean Enable slide indicator dots
pauseIconColor string Color of the pause icon, eg: white
pauseIconSize string size of the pause icon, eg: 40px
slideBackgroundColor string Sets the slides' background color, eg: darkgrey
slideImageFit string Sets the object-fit of the slides' image,
available options contain and cover
thumbnails boolean Enables thumbnail indicators
thumbnailWidth string Width of the thumbnail, defaults to 100px
Comments
  • Feature request: give option to show/hide navigation buttons

    Feature request: give option to show/hide navigation buttons

    In mobile view especially, we don't need the navigation button as swipe feature is there. In desktop we can enable it for swipe. So please give option to do that.

    opened by SatyamKr07 3
  • Show Hide Feature Added For Nav Button

    Show Hide Feature Added For Nav Button

    What was the Issue #2 ?

    There should be a feature which allows user to show/hide the navigation button in carousel

    What does this PR do ?

    This PR adds a new Prop in the Carousel Component named "showNavBtn" which is a boolean type prop and has a default value of true, which when set to true will show the nav button and when false will hide them and fixes #2 .

    Note

    Prettier Rearranged some lines of code without changing the content so that is why in some places you will see same code in green and also in red but don't worry it doesn't affect the code

    hacktoberfest-accepted 
    opened by shishirtiwari23 2
  • How to separate and configure image data into a separate js file?

    How to separate and configure image data into a separate js file?

    You wouldn't normally put all your src image data array in the main js file. So i'm trying to separate them out into a js file and then import them back in but keep getting an error 'data.map... is not a function'. How do i re-configure the code to import the data?

    data.js...

    const data = [
        {
          image: "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/GoldenGateBridge-001.jpg/1200px-GoldenGateBridge-001.jpg",
          caption: `<div>
                      San Francisco
                      <br/>
                      Next line
                    </div>`
        },
        {
          image: "https://cdn.britannica.com/s:800x450,c:crop/35/204435-138-2F2B745A/Time-lapse-hyper-lapse-Isle-Skye-Scotland.jpg",
          caption: "Scotland"
        },
    etc etc
    

    Carousel.js...

    import { Carousel } from 'react-carousel-minimal';
    import data from "../data/data.js";
    
     <Carousel
                data={data}
    

    etc etc

    opened by KevinMull 1
  • Url link in data

    Url link in data

    Hi,

    Your package is very usefull, but is it possible to add a href link in data section to click on slider's picture and been redirect to a specific url or react-dom route ?

    Regards !

    opened by mk-store 0
  • Carousel is not keyboard accessible

    Carousel is not keyboard accessible

    The carousel is not keyboard accessible. You cannot select the arrows or thumbnails when you tab through the page. It would be nice to be able to use left/right arrow keys when you have tabbed into the carousel or the thumbnails, as well.

    Changing the next/prev to

    opened by corriespondent 0
  • How would you use data from redux react? Please share a codesandbox

    How would you use data from redux react? Please share a codesandbox

    for reference see this please: https://stackoverflow.com/questions/73270182/cannot-read-properties-of-undefined-reading-map-stops-the-dispatch-from-hap/73270405#73270405

    opened by mainaani 0
  • Add a way to style the thumbnails

    Add a way to style the thumbnails

    Describe the bug thumbnails are not customizable.

    To Reproduce no property to customize thumbnail

    Expected behavior add a prop thumnailStyle to modify thumbnails

    Screenshots N/A

    opened by smajumder2017 0
  • Create Typescript Declaration

    Create Typescript Declaration

    Describe the bug Issue while using with react typescript

    To Reproduce import it in a react typescript project

    Expected behavior linter should not throw any error while importing

    Screenshots N/A

    opened by smajumder2017 1
Releases(v1.4.1)
Owner
Sahil Saha
Google Code-in 2018 Grand Prize Winner @fossasia | Web Developer | Flutter | Deep learning |
Sahil Saha
React carousel component

react-slick Carousel component built with React. It is a react port of slick carousel Documentation Installation npm npm install react-slick --save ya

Kiran Abburi 10.8k Dec 29, 2022
A Minimal Setup & Fast Boilerplate for React.js with Vite.

A Minimal Setup & Fast Boilerplate for React.js with Vite Features ?? Dynamic Pages Routing with react-router-dom from React.js ?? Fast development wi

Muhammad Fauzan 26 Oct 25, 2022
A draggable and resizable grid layout with responsive breakpoints, for React.

React-Grid-Layout React-Grid-Layout is a grid layout system much like Packery or Gridster, for React. Unlike those systems, it is responsive and suppo

RGL 16.9k Jan 4, 2023
Plock is a responsive masonry layout implementation for React. Very simple to use and easy to understand.

About Plock ?? Plock is a responsive masonry layout implementation for React. Very simple to use and easy to understand. Can I see a demo? ?? The demo

Renato Pozzi 130 Dec 9, 2022
here in this git repo you will get react js basic layout, having in responsive mode.

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 3 Feb 23, 2022
Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.

Recoil · Recoil is an experimental set of utilities for state management with React. Please see the website: https://recoiljs.org Installation The Rec

Facebook Experimental 18.2k Jan 8, 2023
This is a minimal Next.js app where you can create birthday wishes and share the link to anyone :)

Happy Birthday Wisher Check out the Live Website This is a simple Next.js project where you can generate a birthday wish for someone. Just enter their

Gourav Khunger 21 Dec 22, 2022
Minimal Design, a set of components for Angular 9+

Alyle UI Minimal Design, a set of components for Angular. Docs Install Alyle UI Installation Components Feature State Responsive Docs avatar ✔️ ✔️ Doc

Alyle 281 Dec 25, 2022
Create responsive design with the help of css queries

react-native-css-stylesheet Create responsive design with the help of css queries Installation npm install react-native-css-stylesheet Usage Define st

Darshan Jain 4 May 9, 2022
A simple and responsive quizlet-like flashcard component with a few additional options

Welcome to react-quizlet-flashcard ?? A simple and responsive quizlet-like flashcard component with a few additional options. Front and back card acce

A.B.Santhosh 14 Dec 17, 2022
React Starter Kit — isomorphic web app boilerplate (Node.js, Express, GraphQL, React.js, Babel, PostCSS, Webpack, Browsersync)

React Starter Kit — "isomorphic" web app boilerplate React Starter Kit is an opinionated boilerplate for web development built on top of Node.js, Expr

Kriasoft 21.7k Dec 30, 2022
📋 React Hooks for forms validation (Web + React Native)

English | 繁中 | 简中 | 日本語 | 한국어 | Français | Italiano | Português | Español | Русский | Deutsch | Türkçe Features Built with performance and DX in mind

React Hook Form 32.4k Dec 29, 2022
:black_medium_small_square:React Move | Beautiful, data-driven animations for React

React-Move Beautiful, data-driven animations for React. Just 3.5kb (gzipped)! Documentation and Examples Features Animate HTML, SVG & React-Native Fin

Steve Hall 6.5k Jan 1, 2023
React features to enhance using Rollbar.js in React Applications

Rollbar React SDK React features to enhance using Rollbar.js in React Applications. This SDK provides a wrapper around the base Rollbar.js SDK in orde

Rollbar 39 Jan 3, 2023
🎉 toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense!

toastify-react-native ?? toastify-react-native allows you to add notifications to your react-native app (ios, android) with ease. No more nonsense! De

Zahid Ali 29 Oct 11, 2022
Soft UI Dashboard React - Free Dashboard using React and Material UI

Soft UI Dashboard React Start your Development with an Innovative Admin Template for Material-UI and React. If you like the look & feel of the hottest

Creative Tim 182 Dec 28, 2022
A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router.

A web application to search all the different countries in the world and get details about them which can include languages, currencies, population, domain e.t.c This application is built with CSS, React, Redux-Toolkit and React-Router. It also includes a theme switcher from light to dark mode.

Franklin Okolie 4 Jun 5, 2022
Finished code and notes from EFA bonus class on building a React project without create-react-app

React From Scratch Completed Code This is the completed code for the EFA bonus class on building a React project from scratch. Included are also markd

Conor Broaders 3 Oct 11, 2021
Free Open Source High Quality Dashboard based on Bootstrap 4 & React 16: http://dashboards.webkom.co/react/airframe

Airframe React High Quality Dashboard / Admin / Analytics template that works great on any smartphone, tablet or desktop. Available as Open Source as

Mustafa Nabavi 6 Jun 5, 2022