Meet npm Pro: unlimited public & private packages + package-based permissions.Learn more »

swipr

2.1.0 • Public • Published

swipr

npm version

Uses hammer.js for smooth and responsive touch swiping

Installation

yarn add swipr

Usage

import ReactDOM from 'react-dom'
import React, { Component } from 'react'
import swipr from 'swipr'
import style from './swipr.css'
 
class TestComponent extends Component {
  componentDidMount () {
    document.addEventListener('DOMContentLoaded', function () {
      const $elem = document.querySelector('.swipr_example')
      swipr($elem)
    })
  }
 
  render () {
    return (
      <div>
        <div className='swipr_example'>
          <div className='swipr'>
            <ul className='swipr_slides'>
              <li>
                <img src='/react.png' />
              </li>
              <li>
                <img src='/styled-components.png' />
              </li>
              <li>
                <img src='/webpack.png' />
              </li>
            </ul>
        </div>
        <span className='swipr_prev' />
        <span className='swipr_next' />
      </div>
    </div>
    )
  }
}
 
ReactDOM.render(
  <TestComponent />,
  document.getElementById('root')
)

Development

yarn
npm run dev

Build

yarn
npm run build
npm login
npm version patch
git add -A
git push origin master
npm publish

License

MIT

Install

npm i swipr

DownloadsWeekly Downloads

3

Version

2.1.0

License

MIT

Unpacked Size

981 kB

Total Files

15

Last publish

Collaborators

  • avatar