https://github.com/alexweblab/bootstrap-5-breakpoint-react-hook
This React hook returns the current Bootstrap 5 breakpoint (xs, sm, md, lg, xl or xxl) based on the window width.
https://github.com/alexweblab/bootstrap-5-breakpoint-react-hook
Last synced: 19 days ago
JSON representation
This React hook returns the current Bootstrap 5 breakpoint (xs, sm, md, lg, xl or xxl) based on the window width.
- Host: GitHub
- URL: https://github.com/alexweblab/bootstrap-5-breakpoint-react-hook
- Owner: AlexWebLab
- Created: 2021-05-12T06:15:11.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-13T03:10:54.000Z (almost 5 years ago)
- Last Synced: 2025-09-27T21:39:12.786Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# About
This React hook returns the current Bootstrap 5 breakpoint (xs, sm, md, lg, xl or xxl) based on the window width.
## Install
```bash
npm i bootstrap-5-breakpoint-react-hook
```
Or
```bash
yarn add bootstrap-5-breakpoint-react-hook
```
## Usage
1. Include the hook:
```javascript
import useBreakpoint from 'bootstrap-5-breakpoint-react-hook';
```
2. Use it where is needed:
```jsx
function App() {
return (
Current breakpoint: {useBreakpoint()}
);
}
```
### License
Licensed under the MIT License, Copyright © 2021 AlexWebLab