# @blaze-react/switches

> Switches component is a digital on/off switch used for activating one of two predefined options

Latest version **0.8.0-alpha.112** (published 2025-10-01) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install @blaze-react/switches
pnpm add @blaze-react/switches
yarn add @blaze-react/switches
bun add @blaze-react/switches
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.8.0-alpha.112 |
| Published | 2025-10-01 |
| First published | 2019-07-26 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 1.4 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | byte9 |
| Maintainers | marekb9, mcabrerapf, daoyong, grzegorzi, ishrat, andypail, tanane |

## Links

- npm: https://www.npmjs.com/package/@blaze-react/switches
- npm.io page: https://npm.io/package/@blaze-react/switches

## Dependencies (1)

- [@blaze-react/tooltip](https://npm.io/package/@blaze-react/tooltip.md) ^0.8.0-alpha.112

## Recent versions

- 0.8.0-alpha.112 (latest) — 2025-10-01
- 0.8.0-alpha.117 (alpha) — 2026-03-11
- 0.8.0-alpha.115 — 2026-02-23
- 0.8.0-alpha.114 — 2026-01-08
- 0.8.0-alpha.110 — 2025-09-10
- 0.8.0-alpha.103 — 2025-07-07
- 0.8.0-alpha.102 — 2025-07-01
- 0.8.0-alpha.101 — 2025-06-27
- 0.8.0-alpha.100 — 2025-02-26
- 0.8.0-alpha.98 — 2024-11-27
- 0.8.0-alpha.97 — 2024-11-21
- 0.8.0-alpha.96 — 2024-11-21
- 0.8.0-alpha.95 — 2024-11-21
- 0.8.0-alpha.92 — 2024-11-13
- 0.8.0-alpha.90 — 2024-11-12
- … 92 more at https://npm.io/package/@blaze-react/switches/versions

## README

## Description

Switches component is a digital on/off switch used for activating one of two predefined options.

## Usage

- Group

```js
const multiple = [
  {
    id: 1,
    label: 'Switch text',
  },
  {
    id: 2,
    label: 'Switch text',
  },
  {
    disabled: true,
    id: 4,
    label: 'Disabled',
  },
];

<Switches options={multiple} modifier={Switches.availableModifiers.secondary} onChange={({ event, value }) => {}} />;
```

- Single

```js
const single = {
  label: "Switch text",
  required: true
};

<Switches
  options={single}
  returnBoolean
  onChange={({ event, value }) => {}}
```

## API

##### Switches can receive a number of `props` as follow:

| NAME              |      TYPE       |        DEFAULT         | OPTIONS                                                  |
| :---------------- | :-------------: | :--------------------: | -------------------------------------------------------- |
| modifier          |     String      |         empty          | primary, secondary, default, unchecked, checked disabled |
| labelPosition     |     String      |         right          | right, left, top, base                                   |
| validationMessage |     String      | This field is required |
| options           | Array or Object |           []           |
| disabled          |     Boolean     |         false          |
| required          |     Boolean     |         false          |
| returnBoolean     |     Boolean     |         false          |
| error             |     Boolean     |         false          |
| onChange          |    Function     |        () => {}        |

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