# @nocp/toggle

> React Toggle Component

Latest version **0.5.0** (published 2023-09-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nocp/toggle
pnpm add @nocp/toggle
yarn add @nocp/toggle
bun add @nocp/toggle
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.5.0 |
| Published | 2023-09-16 |
| First published | 2023-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 50.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | NriotHrreion |
| Maintainers | nriot |

## Links

- npm: https://www.npmjs.com/package/@nocp/toggle
- Repository: https://github.com/nocpiun/toggle
- Homepage: https://github.com/nocpiun/toggle#readme
- Issues: https://github.com/nocpiun/toggle/issues
- npm.io page: https://npm.io/package/@nocp/toggle

## Recent versions

- 0.5.0 (latest) — 2023-09-16
- 0.4.0 — 2023-09-10
- 0.3.0 — 2023-09-10
- 0.2.0 — 2023-09-10
- 0.1.0 — 2023-09-10

## README

# `@nocp/toggle`

**React Toggle Component**

By NriotHrreion

---

## Installation

```bash
npm i @nocp/toggle
```

## Usage

Import the component

```tsx
import Toggle from "@nocp/toggle";

// style
import "@nocp/toggle/dist/toggle.css";
```

Use the component

```tsx
<Toggle />
```

## Props

|Name|Type|Required|Description|
|:---:|:---:|:---:|---|
|`defaultToggleValue`|`boolean`|No|The default value of the toggle|
|`onToggle`|`(isActive: boolean) => void`|No|Toggling event of the toggle|

Also, the component supports [HTML attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes).

## Styling

The color style of the component can be changed by overriding the following CSS variables.

```css
:root {
    --nocp-toggle-bar-bg: #9e9e9e;
    --nocp-toggle-knob-bg: #dbdbdb;
}
```

## LICENSE

[MIT](./LICENSE)

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