# itsa-react-togglebutton

> Interactive Toggle-button

Latest version **16.0.12** (published 2019-02-22) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install itsa-react-togglebutton
pnpm add itsa-react-togglebutton
yarn add itsa-react-togglebutton
bun add itsa-react-togglebutton
```

## 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 | 16.0.12 |
| Published | 2019-02-22 |
| First published | 2016-02-10 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=5 |
| Dependencies | 2 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | itsasbreuk |
| Keywords | itsasbreuk, itsa, react-component, react, togglebutton, button |

## Links

- npm: https://www.npmjs.com/package/itsa-react-togglebutton
- Repository: https://github.com/ItsAsbreuk/itsa-react-togglebutton
- Homepage: https://github.com/ItsAsbreuk/itsa-react-togglebutton#readme
- Issues: https://github.com/ItsAsbreuk/itsa-react-togglebutton/issues
- npm.io page: https://npm.io/package/itsa-react-togglebutton

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.10
- [itsa-react-button](https://npm.io/package/itsa-react-button.md) ^16.0.10

## 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

- 16.0.12 (latest) — 2019-02-22
- 16.0.11 — 2018-08-23
- 16.0.10 — 2018-08-09
- 16.0.9 — 2018-03-09
- 16.0.7 — 2018-02-19
- 16.0.6 — 2017-11-06
- 16.0.4 — 2017-10-29
- 16.0.3 — 2017-10-28
- 16.0.2 — 2017-06-26
- 16.0.1 — 2017-06-26
- 16.0.0 — 2017-06-23
- 15.1.31 — 2017-01-16
- 15.1.30 — 2016-09-07
- 15.1.29 — 2016-09-02
- 15.1.28 — 2016-08-29
- … 34 more at https://npm.io/package/itsa-react-togglebutton/versions

## README

[![Build Status](https://travis-ci.org/ItsAsbreuk/itsa-react-togglebutton.svg?branch=master)](https://travis-ci.org/ItsAsbreuk/itsa-react-togglebutton)

Interactive Toggle-button.

Lightweight, focussable, responses to keypresses and will act quicker than the HTMLButtonElement.
Meaning, that the onClick-event gets fired on a mouseDown or keyDown event (native HTMLButtonElement emits on mouseUp).

## How to use:

```js
const ReactDOM = require("react-dom"),
      ToggleButton = require("itsa-react-togglebutton");

let props = {
    checked: true
};

const handleChange = () => {
    props.checked = !props.checked;
    renderToggleButton();
};

const renderToggleButton = () => {
    ReactDOM.render(
        <ToggleButton {...props} onChange={handleChange} />,
        document.getElementById("container")
    );
};

renderToggleButton();
```

## About the css

You need the right css in order to make use of `itsa-react-togglebutton`. There are 2 options:

1. You can include the files inside the css-folder of the module: `itsa-react-button`, which is a dependency.
2. You can use: `Component = require("itsa-react-togglebutton/lib/component-styled.jsx");` and build your project with `webpack`. This is needed, because you need the right plugin to handle a requirement of the `scss`-file.


[View live example](http://projects.itsasbreuk.nl/react-components/itsa-togglebutton/component.html)

[API](http://projects.itsasbreuk.nl/react-components/itsa-togglebutton/api/)


#### If you want to express your appreciation

Feel free to donate to one of these addresses; my thanks will be great :)

* Ether: 0xE096EBC2D19eaE7dA8745AA5D71d4830Ef3DF963
* Bitcoin: 37GgB6MrvuxyqkQnGjwxcn7vkcdont1Vmg

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