react-multi-toogle

Made with create-react-library

Usage no npm install needed!

<script type="module">
  import reactMultiToogle from 'https://cdn.skypack.dev/react-multi-toogle';
</script>

README

react-multi-toogle

Made with create-react-library

NPM JavaScript Style Guide

Install

npm install --save react-multi-toogle

or

yarn add react-multi-toogle

Usage

import React from 'react'
import { ReactMultiToogle } from 'react-multi-toogle'
import {
  faSun,
  faMoon,
  faAd,
  faAnchor
} from '@fortawesome/free-solid-svg-icons'

const App = () => {
  return <ReactMultiToogle
    name="testToogle"
    onClick={(state) => {
      console.log(state)
    }}
    options={[
      {
        icon: faSun,
        value: "state1"
      },
      {
        value: "state2",
        icon: faMoon,
      },
      {
        icon: faAd,
        value: "state3"
      },
      {
        icon: faAnchor,
        value: "state4"
      },
    ]}/>
}

export default App

License

MIT © jimx6