1.1.2 • Published 6 years ago
@thebiltheory/usebreakpoints v1.1.2
useBreakpoints
React Hook to map value/breakpoint the styled-component way.
Example/ Demo
Install
npm install --save @thebiltheory/usebreakpointsor
yarn add @thebiltheory/usebreakpointsUsage
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