Security News
Combatting Alert Fatigue by Prioritizing Malicious Intent
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
@regrapes/react-breakpoint-hooks
Advanced tools
This project is maintained by [REGRAPES](https://grapes.de/).
This project is maintained by REGRAPES.
Creates easy to use breakpoint hooks for react, based on @react-hook/media-query
package and inspired by Material UIs breakpoint definitions (can be overwritten).
npm i @regrapes/react-breakpoint-hooks
import { BreakpointProvider } from "@regrapes/react-breakpoint-hooks";
<BreakpointProvider>
<App />
</BreakpointProvider>;
import { useBreakpoints } from "@regrapes/react-breakpoint-hooks";
function App() {
const { isScreenMD } = useBreakpoints();
return (
<div className="App">
{isScreenMD.exact && <div>Renders only on exact screen size MD</div>}
{isScreenMD.up && (
<div>Renders only on screen size MD and above (LG, XL)</div>
)}
{isScreenMD.down && (
<div>Renders only on screen size MD and below (SM, XS)</div>
)}
</div>
);
}
Breakpoint | Size (px) |
---|---|
XS | 0 |
SM | 600 |
MD | 960 |
LG | 1280 |
XL | 1920 |
Inspired by Material UIs breakpoints
useBreakpoints()
provides...
const { isScreenXS, isScreenSM, isScreenMD, isScreenLG, isScreenXL } = useBreakpoints();
Every options provide exact
, up
and down
property, which return a boolean
.
You can use your own breakpoints by passing your own breakpoints into the BreakpointProvider
:
import { BreakpointProvider } from "@regrapes/react-breakpoint-hooks";
const BREAKPOINTS = {
XS: 0,
SM: 600,
MD: 960,
LG: 1280,
XL: 1920,
};
<BreakpointProvider breakpoints={BREAKPOINTS}>
<App />
</BreakpointProvider>;
MIT
FAQs
[![install size](https://packagephobia.com/badge?p=@regrapes/react-breakpoint-hooks@0.1.5)](https://packagephobia.com/result?p=@regrapes/react-breakpoint-hooks@0.1.5)
The npm package @regrapes/react-breakpoint-hooks receives a total of 15 weekly downloads. As such, @regrapes/react-breakpoint-hooks popularity was classified as not popular.
We found that @regrapes/react-breakpoint-hooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
In 2023, data breaches surged 78% from zero-day and supply chain attacks, but developers are still buried under alerts that are unable to prevent these threats.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.