Component
A flexible modern component js plugin.
Introduction
Installation
NPM
npm i @pluginjs/component
Yarn
yarn add @pluginjs/component
Dependencies
Getting Started
Include
Webpack && Rollup:
ECMAScript Modules
import component from "@pluginjs/component"
CommonJS
require("@pluginjs/component")
CDN:
Development:
<script src="/path/to/component.js"></script>
<link rel="stylesheet" href="/path/to/component.css">
Production:
<script src="/path/to/component.min.js"></script>
<link rel="stylesheet" href="/path/to/component.min.css">
Initialize
HTML:
<body>
<div class="element"></div>
</body>
JS:
Pj.Component('.element', options);
$('.element').plugin('Component', options);
API
Methods:
Methods are called on component instances through the component method itself.
You can also save the instances to variable for further use.
Name | Description |
---|
"getDataOptions" | Make plugin themeable |
example:
$component.plugin('Component', getDataOptions)
$component.plugin('Component', getDataOptions, "foo")
$component.plugin('Component', getDataOptions, "foo", "bar")
Browser support
Tested on all major browsers.
| | | | | |
---|
Latest ✓ | Latest ✓ | Latest ✓ | Latest ✓ | >=10 ✓ | Latest ✓ |
As a jQuery plugin, you also need to see the jQuery Browser Support.
Contributing
See Contribution.md.
Changelog
To see the list of recent changes, see Releases section.
Version
Version: 0.2.3
Copyright and license
Copyright (C) 2017 Creation Studio Limited.
Licensed under the GPL-v3 license.