1.2.0 • Published 4 years ago
react-swiper-kinetic v1.2.0
react-swiper
Install
Using npm:
npm install react-swiper-kinetic
or using yarn:
yarn add react-swiper-kinetic
Usage
import React from 'react';
import Swiper from 'react-swiper-kinetic';
class App extends React.PureComponent {
render() {
return (
<Swiper
defaultValue={100}
heading="My Heading"
max={1000}
min={10}
onChange={handleOnChange} // your onChange handler
step={10}
snap={70}
/>
);
}
}
Common API
Property | PropType | Required | Default | Description |
---|---|---|---|---|
defaultValue | number | yes | - | Default value for 1st render |
classes | Object | yes | - | Classes for styling |
className | string | no | - | Class name for root element |
heading | string | yes | - | Heading for Swiper |
limit | number | no | - | Swiper limit number |
limitMessage | ReactNode | no | - | Swiper limit message |
max | number | yes | - | Max value for Swiper |
min | number | yes | - | Min value for Swiper |
onBeforeChange | Function | no | - | Callback function called before starting to move a swiper |
onChange | Function | yes | - | Callback function when value was changed |
snap | number | yes | - | Swiper step and item width |
step | number | yes | - | Step size |
Development
yarn install
yarn storybook