# react-breakpointable

> A React mixin to respond to changing viewport breakpoints

Latest version **0.2.0** (published 2015-04-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-breakpointable
pnpm add react-breakpointable
yarn add react-breakpointable
bun add react-breakpointable
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2015-04-23 |
| First published | 2015-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rob Colburn |
| Maintainers | robcolburn |
| Keywords | react, mixin, breakpoints |

## Links

- npm: https://www.npmjs.com/package/react-breakpointable
- Repository: https://github.com/robcolburn/react-breakpointable
- Issues: https://github.com/robcolburn/react-breakpointable/issues
- npm.io page: https://npm.io/package/react-breakpointable

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2015-04-23
- 0.1.0 — 2015-04-23

## README

# breakpointable
A React Mixin to respond to changing viewport breakpoints

## Integration

Three steps:
1. Add the mixins
2. Define your breakpoints
3. Add a change listener

```jsx
var Breakpointable = require('react-breakpointable');

var MyComponent = React.createClass({
  mixins: [Breakpointable],
  breakpoints [
    {name: 'mobile', width: 0},
    {name: 'desktop', width: 990},
  ],
  onBreakpointChange(breakpointName) {
    // Act on breakpoint
    this.setState({
      breakpoint: breakpointName
    });
  }
  render: function () {
    return <div class={"my-component my-component-" + breakpointName}>
      {breakpointName == "desktop" &&
        <h1>Desktop-only</h1>}
      {breakpointName == "mobile" &&
        <h1>Mobile-only</h1>}
    </div>
  }
});
```

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