@dn-l/react-bootstrap-toggle

React toggle component based on Bootstrap 4

Usage no npm install needed!

<script type="module">
  import dnLReactBootstrapToggle from 'https://cdn.skypack.dev/@dn-l/react-bootstrap-toggle';
</script>

README

@dn-l/react-bootstrap-toggle

React toggle component based on Bootstrap 4

Playground

Quickstart

  1. Install npm package:
npm i @dn-l/react-bootstrap-toggle
yarn add @dn-l/react-bootstrap-toggle
  1. Add styles to your scss/sass file (Toggle component follows button padding variables):
@import "~bootstrap/scss/_functions";
@import "~bootstrap/scss/_variables";

.bootstrap-toggle {
  .animate {
    transition: $transition-base;
  }

  .caption {
    padding: $btn-padding-y $btn-padding-x;
  }
}
  1. That's it! Component accepts some additional props for your convenience. Usage:
import Toggle from "@dn-l/react-bootstrap-toggle";

<Toggle />;