@uofu/components v0.0.9
UofU Web Components
Built using the starter project for building a standalone Web Component using Stencil.
Stencil
Stencil is a compiler for building fast web apps using Web Components.
Stencil combines the best concepts of the most popular frontend frameworks into a compile-time rather than run-time tool. Stencil takes TypeScript, JSX, a tiny virtual DOM layer, efficient one-way data binding, an asynchronous rendering pipeline (similar to React Fiber), and lazy-loading out of the box, and generates 100% standards-based Web Components that run in any browser supporting the Custom Elements v1 spec.
Stencil components are just Web Components, so they work in any major framework or with no framework at all.
Getting Started
To develop this web component using Stencil, clone the repo to a new directory and run:
npm install
npm start
To build the component for production, run:
npm run build
To run the unit tests for the components, run:
npm test
Need help? Check out the stencil docs here.
Using this component
Script tag
- Put a script tag similar to this
<script src='https://unpkg.com/@uofu/components@latest/dist/uofu.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 @uofu/components --save
- Put a script tag similar to this
<script src='node_modules/@uofu/components/dist/uofu.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 app
- Run
npm install @uofu/components --save
- Add an import to the npm packages
import @uofu/components;
- Then you can use the element anywhere in your template, JSX, html etc
Available Web Components
utah-header
Parameters:
- app -- application name to appear in the header
utah-nav
coming soon
utah-footer
- appName -- application name to appear in the footer
- address1 -- address line 1 appear in the footer
- address2 -- address line 2 appear in the footer
- phone -- phone number appear in the header