@baianat/switcher

0.0.1 • Public • Published

Switcher

ES6 extension to add a dragging behavior to the Base framework switcher component.

Getting Started

Installation

You can install modal as part of base.extensions.

npm install @baianat/base.extensions

# or using yarn
yarn add @baianat/base.extensions

If you want the standalone version.

npm install @baianat/switcher

yarn add @baianat/switcher

Include necessary files

<head>
  <!-- if you are using base.framework -->
  <link rel="stylesheet" href="@baianat/base.framework/dist/css/base.css">

  <!-- if you want only switcher stylesheet -->
  <link rel="stylesheet" href="@baianat/modal/dist/css/switcher.css">
</head>
<body>
    ...
    <script type="text/javascript" src="dist/js/switcher.js"></script>
</body>

HTML Layout

  • .switcher
    • .switcher-input
    • .switcher-body
      • .switcher-handle
<div class="switcher">
   <input id="switcher" type="checkbox" checked="checked" class="switcher-input">
   <label for="switcher" class="switcher-body">
      <span class="switcher-handle"></span>
  </label>
</div>

Once you include the script file, it will search for an element with .switcher class and adds the dragging behavior to it.

License

MIT

Copyright (c) 2017 Baianat

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @baianat/switcher

      Weekly Downloads

      2

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • baianaters