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

@razorblades/blades-webcomponent

v0.3.3

Published

WebComponents to render a Blade Layout (famous due to the Azure Portal) using lightweight modern JavaScript, DOM and HTML.

Downloads

8

Readme

RazorBlades - Web Component

WebComponents to render a Blade Layout (famous due to the Azure Portal) using lightweight modern JavaScript, DOM and HTML.

npm Published on webcomponents.org

Walk through & features

Javscript & CSS

<script type="module" src="blades-webcomponent.js"></script>

RazorBlades Web Component are distributed using a JavaScript module. Feel free to download, minimize, bundle and host it on your own. CSS is currently embedded in the WebComponent JavaScript.

Hosted in a parent element

<blade-host>
</blade-host>

The host consume all space from its parent using position:absolute;left:0;top:0;width:100%;height:100%. You have to box it adequately.

Blade Stacks are aligned in stacks

Note: multiple stacks are not yet implemented

<blade-host>
    <blade-stack id="stack1">
    </blade-stack>
</blade-host>

The stacks overflow horizontally. Be prepared for a scrollbar.

The blade-host DOM Element has a property stacks which returns an array of the displayed stacks.

Blades are added to stacks and have content

<blade-host>
    <blade-stack id="stack1">
        <blade-blade id="blade1" title="Settings" sub-title="Overview" icon="🎚">
            Hello World
        </blade-blade>
    </blade-stack>
</blade-host>

The title and sub-title attributes are mandatory.

The blade-stack DOM Element has a property blades which returns an array of the displayed blades.

Adding buttons into web component slots

<blade-host>
    <blade-stack id="stack1">
        <blade-blade id="blade1" title="Settings" sub-title="Overview" icon="🎚">
            <button slot="blade-buttons" onclick="document.getElementById('blade1').setAttribute('title', 'blub');">➕ Change Title</button>
            Hello World
        </blade-blade
    </blade-stack>
</blade-host>

Buttons in the body can be added to a slot within the blade's button row. They are formatted by the web component but behave otherwise like any button.

Specification, Testing & Other

  1. RazorBlades are tested and developed using Firefox.
    • Firefox (Evergreen at moment of release)
    • Chrome (Evergreen at moment of release)
    • IE11 support may be achieved using polyfills. We do not test or support this.
  2. Technology

License

MIT Licensed