JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 100
  • Score
    100M100P100Q76765F
  • License MIT

A switch button (on/off) React component.

Package Exports

  • lyef-switch-button

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lyef-switch-button) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Lyef Switch Button

Build Status Badge size Badge gzip size NPM version

Switch Button

A switch button (on/off) React component.

Demo

Live examples

Installation

$ npm install --save lyef-switch-button

Remember to import the styles on css/main.css folder to your project.

Basic Usage

import SwitchButton from 'lyef-switch-button';

...
render() {
    return (
        <SwitchButton
            id="my-button"
            labelLeft="left"
            labelRight="right"
            isChecked
            disabled
            action={callbackFunction}
        />
    );
}
...

Props

  • id (string)- required
  • labelLeft (string) - create a label to the left of the button
  • labelRight (string) - create a label to the right of the button
  • isChecked (bool) - start the button as checked
  • disabled (bool) - disable the button for user interaction
  • action (func) - call a function when the input is changed

Architecture

We've developed this component using the following boilerplate: lyef-react-component.

To know more about the architecture or if you want to contribute with this component: Contributing Documentation.

License

MIT License @ lyef