@thebiltheory/usebreakpoints
v1.1.2
Published
React Hook to map value/breakpoint the styled-component way.
Downloads
240
Readme
useBreakpoints
React Hook to map value/breakpoint the styled-component way.
Example/ Demo
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