0.0.3 • Published 7 years ago
collective-webcomponents v0.0.3
Collective Webcomponents
Webcomponents for Collective made with Stencil
Getting Started
To start building a new web component using Stencil, clone this repo to a new directory:
git clone https://github.com/builder/collective-webcomponents.git
cd collective-webcomponentsand run:
npm install
npm startTo watch for file changes during develop, run:
npm run devTo build the component for production, run:
npm run buildTo run the unit tests for the components, run:
npm testTry using Visual Studio Code to view and edit this code, it has best in class typescript/tsx support.
Need help? Check out the stencil docs here.
Using these components
Script tag
- Publish to NPM
- Put a script tag similar to this
<script src='https://unpkg.com/collective-webcomponents@0.0.1/dist/collectivewebcomponents.js'></script>in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
Node Modules
- Run
npm install collective-webcomponents --save - Put a script tag similar to this
<script src='node_modules/collective-webcomponents/dist/collectivewebcomponents.js'></script>in the head of your index.html - Then you can use the element anywhere in your template, JSX, html etc
In a stencil-starter app
- Run
npm install collective-webcomponents --save - Add an import to the npm packages
import collective-webcomponents; - Then you can use the element anywhere in your template, JSX, html etc