New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-styled-carousel

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-styled-carousel

React styled-components carousel. No css is needed, fully configurable, SSR supported. Theming supported.

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
251
decreased by-21.56%
Maintainers
1
Weekly downloads
 
Created
Source

React Styled Slider

React Styled Slider is a react and styled component slider. It is fully configurable.

Build Status Coverage Status

Live Image

Features
  • Mostly configurable
  • Styled-Components
  • No external CSS required.
  • Server Side Rendering supported

Note: Server Side Rendering works well without the styled-components collectStyles function also. But for better user experience please use collectStyles function from styled-components

Installation
$ npm install --save react-styled-carousel
Running example in local
$ git clone github.com/itsMrAkhil/react-styled-carousel
$ npm start

It'll open localhost:9000 port, where you can see live demo.

Example
import React from 'react';
import ReactDOM from 'react-dom'
import Slider from 'react-styled-carousel';

const ExampleSlider = () => (
  <Slider>
    <h1>1</h1>
    <h1>2</h1>
    <h1>3</h1>
    <h1>4</h1>
  </Slider>
);

ReactDOM.render(<ExampleSlider />, document.getElementById('root'));
Responsive

react-styled-carousel is responsive. Below is the example configuration of responsiveness.

Note: If responsive prop is provided then, it'll override the cardsToShow prop. In other words cardsToShow will not work.

import React from 'react';
import ReactDOM from 'react-dom'
import Slider from 'react-styled-carousel';

const responsive = [
  { breakPoint: 1280, cardsToShow: 4 }, // this will be applied if screen size is greater than 1280px. cardsToShow will become 4.
  { breakPoint: 760, cardsToShow: 2 },
];

const ExampleSlider = () => (
  <Slider reponsive={responsive} >
    <h1>1</h1>
    <h1>2</h1>
    <h1>3</h1>
    <h1>4</h1>
  </Slider>
);

ReactDOM.render(<ExampleSlider />, document.getElementById('root'));
Configurable Props
PropsTypeDefault ValueDescription
showArrowsBooleantrueIf true then only Arrows of navigation will be shown
showDotsBooleantrueShow navigation or pagination dots below the slider
infiniteBooleantrueInfinitely slide cards.
DotReact NodeDefaultCustomized pagination button (Active slide Dot will get active as Boolean prop.)
DotsWrapperStyled ElementDefaultCustomized wrapper for your component to change the view of dots wrapper like position, background, etc. Note: It should be a styled ul, otherwise you may not see any Dot Components.
LeftArrowReact NodeDefaultCustomized left arrow button. It'll get disabled Boolean prop if first Dot is active and infinite is false.
RightArrowReact NodeDefaultCustomized right arrow button. It'll get disabled Boolean prop if last Dot is active and infinite is false.
childrenReact NodenullCards are components which you want to show in the carousel
cardsToShowNumberChildren lengthHow many cards to be shown for a single slide.
afterSlideFunctionnullThis function will be executed after every sliding is completed
beforeSlideFunctionnullThis function will be executed before starting every sliding
responsiveArraynullUse this for responsiveness Documentation
autoSlideNumber or Boolean2000Used to make carousel auto slide for every given time interval. Or for 2000ms if the prop value is true.
pauseOnMouseOverBooleantruePause auto sliding on mouse over the carousel.
hideArrowsOnNoSlidesBooleantrueHide arrows if there is only one slide to show.
marginString0pxAny valid css margin value for giving margin around the slider
paddingString0px 20pxAny valid css padding value for giving padding around the slider

License

MIT (Free Software, Chill Yeah!)

Keywords

FAQs

Package last updated on 13 Mar 2019

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