Skip to content

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

Notifications You must be signed in to change notification settings

AlexWebLab/bootstrap-5-breakpoint-react-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published