# breakpoint-checker

> Query window viewport or element widths with specific breakpoints

Latest version **1.0.0** (published 2017-05-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install breakpoint-checker
pnpm add breakpoint-checker
yarn add breakpoint-checker
bun add breakpoint-checker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-05-21 |
| First published | 2017-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mark Notton |
| Maintainers | marknotton |

## Links

- npm: https://www.npmjs.com/package/breakpoint-checker
- Repository: https://www.npmjs.com/package/breakpoint-checker
- npm.io page: https://npm.io/package/breakpoint-checker

## Recent versions

- 1.0.0 (latest) — 2017-05-21

## README

# Breakpoint Checker

Query window viewport or element widths with specific breakpoints

## Installation

### [NPM](https://www.npmjs.com/package/breakpoint-checker)
```
npm i breakpoint-checker
```

### [Yarn](https://yarnpkg.com/en/package/breakpoint-checker)
```
yarn add breakpoint-checker
```

### Bower
```
bower install breakpoint-checker --save
```

## Usage

If the window viewport is equal or lower than the given breakpoint return true
```
if (breakpoint(breaks.medium)) {
  ...
}
```

If the windw viewport is equal or lower than the given breakpoint name return true
```
if (breakpoint('medium')) {
  ...
}
```

Rather than calling an if statment, you can check the width of a given element against a given breakpoint
and call an anonymous function if the element width is equal or less than the given breakpoint
```
$('body').breakpoint(breaks.medium, function() {
  ...
});
```

Simple check. Checks if the current window is less than or equal to the given breakpoint
```
breakpoint('medium');
```

Calls function if given breakpoint if euqal or less than the window viewport
```
breakpoint('medium', function() {
  ...
});
```

You can add breakpoints manually too. So you don't have to rely on custom-props and customPropsExention for this plugin
If the name is the same as a previously defined breakpoint. It will be overwritten
```
addBreakpoint('small', 111);
addBreakpoint({'special': 222, 'small' : 333});
```

---
_Source: https://npm.io/package/breakpoint-checker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
