npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vionic

v8.0.1

Published

A Ionic Framework loader for vanilla JavaScript projects.

Downloads

1

Readme

Vionic package

Vionic is a NPM package to load the Ionic framework with just vanilla JavaScript. It is licensed as open-source under the MIT license.

Vionic allows developers to employ the Ionic framework in pure offline apps. Unlike common examples, it is neither required to link to an online CDN nor to utilize a web framework like React, Vue or Angular.

Take a look at the Vionic example app or read the installation and usage sections below, if you want to know how to use Vionic in your project.

Installation

Just install Vionic like any other NPM package:

npm install vionic

The vionic package includes the Ionic core and Ionicons packages as dependencies.

Versioning

Vionic uses semantic versioning with some little tweaks:

  • Major: Same as the major version of the underlying Ionic core package.
  • Minor: Updated when a new feature or icon has been added.
  • Patch: Updated when a bugfix or minor improvement occurred.

Breaking changes will only happen when the major version changes.

Usage

First, add the following line to the main CCS file of the project to load the Ionic CSS:

@import "vionic/styles.css";

To load all Ionic components and icons at once, the following lines need to be added to the main JavaScript module of the app:

export * from "vionic/components/";
export * from "vionic/icons/";

However, the loading process can take quite some time, so it is recommended to load components and icons individually.

Components

If you want to use an Ionic component, you have to load it before you can use it. Assuming you want to create a new web-component with an ion-button, the code could look like follows:

export * from "vionic/components/ion-button";

const html = "<p><ion-button>Add something</ion-button></p>";

window.customElements.define("button-example", class extends HTMLElement {
    connectedCallback() {
      this.innerHTML = html;
    }
  }
);

Icons

Similar to a component, a named icon also has to be loaded explicitly before use. Assuming you would replace the button-text in the example above with an icon, the following code could be used:

export * from "vionic/components/ion-button";
export * from "vionic/components/ion-icon";
export * from 'vionic/icons/add.js';

const html = "<p><ion-button><ion-icon name="add"></ion-icon></ion-button></p>";

window.customElements.define("button-example", class extends HTMLElement {
    connectedCallback() {
      this.innerHTML = html;
    }
  }
);

Building

The JavaScript files in the components and icons directories have been generated from the JavaScript files in the template directory.

Run the following NPM commands to update the component and icon loader scripts:

npm run update-components
npm run update-icons

Acknowledgements

While developing this packages supertorpe's ionic-vanilla-js repository helped me a lot to understand the underlying logic of the Ionic loading process.


Copyright (c) 2024 Torben Haase <https://letorbi.com>