catalyst-toggle-mixin
<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.