responsive

2.0.0 • Public • Published

responsive

Simple window size checkpoints in the browser.

Install

npm i -S responsive

Usage

import responsive from 'responsive'
 
const opts = {
  checkpoints: {
    small: {
      width: [0, 400]
    },
    big: {
      width: [401, null]
    }
  }
}
responsive(opts, data => {
  // This callback fires immediately and whenever the window size changes
  console.log(data)
  // {
  //   width: 824,
  //   height: 977,
  //   square: false,
  //   portrait: true,
  //   landscape: false,
  //   matches: ['big']
  // }
})

Dependents (0)

Package Sidebar

Install

npm i responsive

Weekly Downloads

144

Version

2.0.0

License

MIT

Unpacked Size

2.54 kB

Total Files

4

Last publish

Collaborators

  • will123195