@catalyst-elements/catalyst-labelable-mixin

A mixin that makes an element labelable.

Usage no npm install needed!

<script type="module">
  import catalystElementsCatalystLabelableMixin from 'https://cdn.skypack.dev/@catalyst-elements/catalyst-labelable-mixin';
</script>

README

catalyst-labelable-mixin

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

API documentation ↗

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

Installation

Install with npm:

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

Install with yarn:

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

Please note that this package is not compatible with Bower.

Usage

As a Module (Recommend)

import CatalystLabelableMixin from './node_modules/@catalyst-elements/catalyst-labelable-mixin/catalyst-labelable-mixin.js';

class MyLabelableElement extends CatalystLabelableMixin(HTMLElement) {
  constructor() {
    super();
    // ...
  }

  // ...
}

As a Script

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

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

  // ...
</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.