Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-hgs-simple-carousel

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-hgs-simple-carousel

Simple and light Carousel

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

A light and simple react carousel.(power by es6-simple-carousel)

1. Getting Started

  • add SimpleCarousel from react-hgs-simple-carousel on your component.
// ...
import SimpleCarousel from 'react-hgs-simple-carousel';

// optional
import 'es6-simple-carousel/dist/styles/custom.css',
//...
// ...
import React from 'react';

//...
// on main function
const slideConfig = {
  threshold: 50,
  infinite: true,
  nav: true,
  dots: true,
  autoPlay: false,
  responsive: {
    0: {
      items: 1.5
    },
    560: {
      items: 3
    },
    760: {
      items: 2.5
    }
  }
};
// ....

3. use config on your component's body

  <div class="container">
      <SimpleCarousel className="myCarousel" slideConfig={slideConfig}>
          <span className="slide">Slide 1</span>
          <span className="slide">Slide 2</span>
          <span className="slide">Slide 3</span>
          <span className="slide">Slide 4</span>
          <span className="slide">Slide 5</span>
          <span className="slide">Slide 6</span>
          <span className="slide">Slide 7</span>
      </SimpleCarousel>
  </div>

for EX:

import React from 'react';
import SimpleCarousel from './components/slider';
import 'es6-simple-carousel/dist/styles/custom.css';

function App() {
  const slideConfig = {
    threshold: 50,
    infinite: true,
    nav: true,
    dots: true,
    autoPlay: false,
    responsive: {
      0: {
        items: 1.5
      },
      560: {
        items: 2.5
      },
      760: {
        items: 3
      }
    }
  };

  return (
    <div className="container">
      <SimpleCarousel className="myCarousel" slideConfig={slideConfig} >
          <span className="slide">Slide 1</span>
          <span className="slide">Slide 2</span>
          <span className="slide">Slide 3</span>
          <span className="slide">Slide 4</span>
          <span className="slide">Slide 5</span>
          <span className="slide">Slide 6</span>
          <span className="slide">Slide 7</span>
      </SimpleCarousel>
    </div>
  );
}
export default App;


Keywords

FAQs

Package last updated on 25 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc