1.0.5 • Published 3 years ago

react-corni-slider v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

React Corni Slider

Introduction

Native horizontal scrolling carousel. Allows scrolling without added animations. The configuration enables a number of configuration options.

Demo

Demo

The component

  <Slider config={config} data={data} component={Card} />

Configuration

PropertyDescriptionTypeDefault value
itemsToShowVisible itemsNumber1
itemsToSlideItems that will slideNumber1
gutterHorizontal padding for each itemNumber0
showDotsShow dots for block navigationBooleanfalse
dotsStylesStyle for dotsObject
nextVisibleItemWidthShow the a part of the next item after the number of items selected as itemsToShow. The value will be in pxNumber0
animationVelocityAnimation in msNumber300
responsiveIt's possible to define a configuration by breakpoint. This configuration will have the previous propertiesObject
showArrowShow the arrows button. You can styleBooleantrue
arrowsPass the component to customize each arrow: left and rightObject< and >

Example

const config = {
  itemsToShow: 3,
  itemsToSlide: 3,
  gutter: 10,
  showDots: true,
  dotsStyles: {},
  nextVisibleItemWidth: 100,
  animationVelocity: 300,
  responsive: {
    0: {
      itemsToShow: 1,
      itemsToSlide: 1,
      gutter: 5,
      showDots: true,
      nextVisibleItemWidth: 50,
      animationVelocity: 300,
    },
    414: {
      itemsToShow: 2,
      itemsToSlide: 1,
      gutter: 5,
      showDots: true,
      nextVisibleItemWidth: 50,
      animationVelocity: 300,
    },
    767: {
      itemsToShow: 3,
      itemsToSlide: 1,
      gutter: 10,
      showDots: true,
      nextVisibleItemWidth: 75,
      animationVelocity: 500,
    },
    1024: {
      itemsToShow: 5,
      itemsToSlide: 5,
      gutter: 10,
      showDots: true,
      nextVisibleItemWidth: 100,
      animationVelocity: 500,
    },
  },
  showArrows: true,
  arrows: {
    left: <div>L</div>,
    right: <div>R</div>,
  },
  ssr: 1024,
};

Data

It is the array you need to pass to create the list of items. Each item will be an object with the properties you need to pass to your component.

Component

The component o card to show inside de carousel.


Available Scripts

In the project directory, you can run:

npm run build

Builds the app before publish to npm js.

npm run test

Launches the test runner in the interactive watch mode.

npm run storybook

Run storybook in 6006 port.

npm run build-storybook

Build the storybook.

npm run deploy-storybook

Deploy to Git hub pages the storybook. Previously you need to build storybook.

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago