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 🙏

© 2026 – Pkg Stats / Ryan Hefner

wc-f7

v0.7.2

Published

Framework7 Web Component adapter

Downloads

15

Readme

wc-f7

wc-f7 is a Framework7 setup that provides seamless integration with Web Components

Architecture

wc-f7 extends Framework7 core modules replacing the router component loader with one that accepts a Web Component declaration (tag name or class constructor) instead of a Framework7 component model. As a side effect, vdom (Snabbdom) and parser/loader modules are not imported/bundled.

Features

  • Declares Framework7 pages as Web Components
  • Supports async rendering (e.g. LitElement / SkateJS)
  • Bundle size smaller than Framework7 core
  • Supports component lifecycle hooks and page events
  • No hard dependency on a specific Framework7 version (any v4 version should work)

Caveats

  • Does not works with shadow dom, due to the Framework7 architecture
  • Only ES modules build is provided

Install

$ npm install wc-f7 framework7

Usage

Define component class

import { LitElement, html } from 'lit-element'


export class IndexPage extends LitElement {
  // page events are declared in static property $on
  static get $on() {
    return {
      pageMounted: function(e, page) {
        console.log('page mounted')
      },
      pageInit: function(e, page) {
        console.log('page init', this.level)
      } 
    }
  }

  get level() {
    // $route, $router, $app, $f7, $theme properties are avaliable in instance 
    return +this.$route.params.level || 0
  }

  // disables shadow dom
  createRenderRoot() {
    return this
  }

  // lifecycle hooks must be declared with $ prefix
  $created() {
    console.log('$created', this.level)
  }

  $beforeMount() {
    console.log('$beforeMount', this.level)
  }

render() {
    const level = this.level
    const message = level ? 'Hello Again' : 'Hello World!'
    return html`
      <div class="navbar">
        <div class="navbar-inner">
          ${level
            ? html`
                <div class="left">
                  <a href="#" class="link icon-only back">
                    <i class="icon icon-back"></i>
                  </a>
                </div>
              `
            : ''}
          <div class="title">Page - Level ${level}</div>
        </div>
      </div>
      <div class="page-content">
        <div class="block-title">${message}</div>
        <div class="list links-list">
          <ul>
            <li>
              <a href="/my-page/level/${level + 1}" class="next-link">Next Page</a>
            </li>
          </ul>
        </div>
      </div>
    `
  }
}

customElements.define('index-page', IndexPage)

Create the app and setup the route

import Framework7 from 'wc-f7' // 'wc-f7/bundle' for all components bundled
import { IndexPage } from './index/index-page'

const app = new Framework7({
  root: '#app',
  routes: [
    {
      path: '/my-page/level/:level',
      component: IndexPage // or 'index-page'
    },
  ],
})

See examples folder for complete apps


Copyright © 2019 Luiz Américo Pereira Câmara