@thebiltheory/usebreakpoints
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

useBreakpoints

CircleCI NPM npm npm

React Hook to map value/breakpoint the styled-component way.

Example/ Demo

Edit useBreakpoints

Install

npm install --save @thebiltheory/usebreakpoints

or

yarn add @thebiltheory/usebreakpoints

Usage

const [value, currentBreakpoint] = useBreakpoints(
  ['mobile', 'tablet', 'desktop', 'huge screen'],
  [576, 768, 992, 1600]
)

const [value, currentBreakpoint] = useBreakpoints(
  [1, 2, 3, 4],
  [576, 768, 992, 1200]
)

import theme from 'src/theme'
const [value, currentBreakpoint] = useBreakpoints(
  [1, 2, 3, 4],
  theme.breakpoints
)

License

MIT © TheBilTheory

Readme

Keywords

none

Package Sidebar

Install

npm i @thebiltheory/usebreakpoints

Weekly Downloads

55

Version

1.1.2

License

MIT

Unpacked Size

23.9 kB

Total Files

17

Last publish

Collaborators

  • thebiltheory