Skip to content

Latest commit

 

History

History
39 lines (27 loc) · 608 Bytes

File metadata and controls

39 lines (27 loc) · 608 Bytes

About

This React hook returns the current Bootstrap 5 breakpoint (xs, sm, md, lg, xl or xxl) based on the window width.

Install

npm i bootstrap-5-breakpoint-react-hook

Or

yarn add bootstrap-5-breakpoint-react-hook

Usage

  1. Include the hook:

    import useBreakpoint from 'bootstrap-5-breakpoint-react-hook';
  2. Use it where is needed:

    function App() {
     return (
       <div>
         Current breakpoint: {useBreakpoint()}
       </div>
     );
    }

License

Licensed under the MIT License, Copyright © 2021 AlexWebLab