@catalyst-elements/catalyst-toggle-mixin

0.5.3 • Public • Published

catalyst-toggle-mixin

Travis David David npm (scoped) Bower not supported Polymer 2 not supported Polymer 3 support pending

API documentation

<catalyst-toggle-mixin> is a mixin that provides an element with toggle behavior.

Installation

Install with npm:

npm install --save @catalyst-elements/catalyst-toggle-mixin

Install with yarn:

yarn add @catalyst-elements/catalyst-toggle-mixin

Please note that this package is not compatible with Bower.

Usage

As a Module (Recommend)

import CatalystToggleMixin from './node_modules/@catalyst-elements/catalyst-toggle-mixin/catalyst-toggle-mixin.js';

class MyToggleElement extends CatalystToggleMixin(HTMLElement) {
  constructor() {
    super();
    // ...
  }

  // ...
}

As a Script

<script src="node_modules/@catalyst-elements/catalyst-toggle-mixin/catalyst-toggle-mixin.es5.min.js"></script>
<script>
  var SuperClass = window.CatalystElements.CatalystToggleMixin(HTMLElement);

  function MyToggleElement() {
    SuperClass.call(this);
    // ...
  };
  MyToggleElement.prototype = Object.create(SuperClass.prototype);
  MyToggleElement.prototype.constructor = MyToggleElement;

  // ...
</script>

Please note that this script has been transpiled to es5 and thus use of custom-elements-es5-adapter.js or an equivalent library is required. See es5 support on the Catalyst Elements wiki for details.

Contributions

Contributions are most welcome.

Please read our contribution guidelines.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @catalyst-elements/catalyst-toggle-mixin

    Weekly Downloads

    60

    Version

    0.5.3

    License

    BSD-3-Clause

    Unpacked Size

    24.7 kB

    Total Files

    6

    Last publish

    Collaborators

    • catalyst-elements