0.5.0 • Published 8 months ago

@nocp/toggle v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@nocp/toggle

React Toggle Component

By NriotHrreion


Installation

npm i @nocp/toggle

Usage

Import the component

import Toggle from "@nocp/toggle";

// style
import "@nocp/toggle/dist/toggle.css";

Use the component

<Toggle />

Props

NameTypeRequiredDescription
defaultToggleValuebooleanNoThe default value of the toggle
onToggle(isActive: boolean) => voidNoToggling event of the toggle

Also, the component supports HTML attributes.

Styling

The color style of the component can be changed by overriding the following CSS variables.

:root {
    --nocp-toggle-bar-bg: #9e9e9e;
    --nocp-toggle-knob-bg: #dbdbdb;
}

LICENSE

MIT

0.5.0

8 months ago

0.4.0

8 months ago

0.3.0

8 months ago

0.2.0

8 months ago

0.1.0

8 months ago