An open API service indexing awesome lists of open source software.

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.

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