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

butterfly-framework

v1.5.0

Published

Butterfly is a modern front-end framework that combines CSS utilities, prebuilt components, and flexible JS features to make building web apps faster and easier.

Readme

Butterfly is a modern front-end framework that combines CSS utilities, prebuilt components, and flexible JS features to make building web apps faster and easier. Designed for developers who want speed, simplicity, and full control, Butterfly offers both a robust styling system and powerful JS tools for dynamic behavior.


🚀 Features

CSS & Styling

  • Utilities: Spacing, colors, typography, flex/grid, and more.
  • Basic Components: Buttons, inputs, navbar, alerts, ranges, progress, dropdowns, etc.
  • Base Styles: Default typography, resets, and responsive defaults.

JavaScript Features

  • Custom Attributes: Extend HTML elements with special behavior.
  • Events: Easily attach and handle custom events.
  • Custom Fetch: Simplify AJAX calls with built-in utilities.
  • Macros: for, if, else, continue, break and more for dynamic rendering.
  • Custom Tags: Build reusable HTML-like components.
  • Animations: Lightweight JS animations for interactivity.

Butterfly Manipulators

Manipulators (@ tags) let you declaratively handle events, timers, validations, DOM changes, and interactive behaviors directly in HTML —no extra JavaScript required.

| Manipulator | Description | Example | |------------|-------------|---------| | @click | Trigger function on click | <button @click="handleClick()">Click Me</button> | | @dbclick | Trigger function on double click | <div @dbclick="doubleTap()">Double Click</div> | | @m-down | Mouse down event | <div @m-down="startDrag()">Drag</div> | | @m-move | Mouse move event | <div @m-move="trackMouse()"></div> | | @m-over | Mouse over | <div @m-over="hoverEffect()">Hover</div> | | @m-up | Mouse up | <div @m-up="stopDrag()"></div> | | @m-out | Mouse out | <div @m-out="hoverLeave()"></div> | | @m-wheel | Mouse wheel scroll | <div @m-wheel="zoom(event)"></div> | | @scroll | Scroll event | <div @scroll="onScroll()"></div> | | @paste | Paste event | <input @paste="handlePaste()"> | | @copy | Copy event | <input @copy="handleCopy()"> | | @k-press | Key press event | <input @k-press="keyPressed()"> | | @k-down | Key down event | <input @k-down="keyDown()"> | | @k-up | Key up event | <input @k-up="keyUp()"> | | @load | Window/document load | <body @load="init()"> | | @change | Change event | <input @change="valueChanged()"> | | @resize | Resize body/document | <div @resize="resizeHandler()"> | | @blur | Blur event | <input @blur="onBlur()"> | | @submit | Form submit | <form @submit="handleSubmit()"> | | @search | Search input | <input type="search" @search="onSearch()"> | | @input | Input change | <input @input="updateValue()"> | | @select | Select event | <input @select="onSelect()"> | | @reset | Form reset | <form @reset="onReset()"> | | @focus | Focus event | <input @focus="onFocus()"> | | @drag | Drag event | <div @drag="dragging()"> | | @drag-start | Drag start | <div @drag-start="startDrag()"> | | @drag-end | Drag end | <div @drag-end="endDrag()"> | | @drag-over | Drag over | <div @drag-over="allowDrop()"> | | @drag-enter | Drag enter | <div @drag-enter="onEnter()"> | | @drag-leave | Drag leave | <div @drag-leave="onLeave()"> | | @interlude | Run function repeatedly with interval | <div @interlude="tick()" @time="1000"></div> | | @halt | Run function after delay | <div @halt="doOnce()" @time="2000"></div> | | @countdown | Countdown timer with callback | <span @countdown="done()" @tick="5000">((countdown))</span> | | @input-min | Minimum input length | <input @input-min="3"> | | @input-max | Maximum input length | <input @input-max="10"> | | @regex | Validate input with regex | <input @regex="email"> | | @toggle | Toggle class(es) on click | <button @toggle="active" @target="#panel">Toggle</button> | | @show | Make element visible | <div @show>Visible</div> | | @hide | Hide element | <div @hide>Hidden</div> | | @src | Set src attribute | <img @src="image.jpg"> | | @fallback | Set alt text | <img @fallback="No image"> | | @link | Set href | <a @link="https://example.com">Go</a> | | @text | Set innerHTML | <div @text="Hello"></div> | | @placeholder | Set input placeholder | <input @placeholder="Enter name"> | | @compute | Evaluate expression and insert result | <span @compute="Math.random()*10"></span> | | @class | Set className | <div @class="card"></div> | | @id | Set id | <div @id="unique"></div> | | @clip | Copy text to clipboard | <button @clip="this.textContent">Copy</button> | | @progress-min | Set progress min | <progress @progress-min="0" @progress-max="100" @progress-val="25"></progress> | | @progress-max | Set progress max | <progress @progress-min="0" @progress-max="200" @progress-val="50"></progress> | | @progress-val | Set progress value | <progress @progress-min="0" @progress-max="100" @progress-val="75"></progress> | | @progress-color | Set progress bar color | <progress @progress-min="0" @progress-max="100" @progress-val="50" @progress-color="#f067b2"></progress> | | @progress-bg | Set progress background | <progress @progress-min="0" @progress-max="100" @progress-val="50" @progress-bg="#eee"></progress> | | @progress-height | Set progress height | <progress @progress-min="0" @progress-max="100" @progress-val="50" @progress-height="20px"></progress> | | @range-color | Set range input color | <input type="range" @range-color="#f067b2"> | | @range-bg | Set range input background | <input type="range" @range-bg="#eee"> | | @trim | Trim whitespace on input | <input @trim> | | @sanitize | Remove unsafe characters | <input @sanitize="soft"> | | @log | Log value/content to console | <div @log="this">...</div> |

Developer-Friendly

  • Lightweight and fast
  • Fully modular: use only what you need
  • Compatible with plain HTML or other frameworks

📦 Installation

Add the following links to your HTML <head> to include Butterfly via CDN:

<!--CSS & JS-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/VTom21/butterfly@master/dist/styles/bundle.min.css">
<script type="module" src="https://cdn.jsdelivr.net/gh/VTom21/butterfly@master/dist/js/index.min.js"></script>

Alternatively, you can use npm:

npm i butterfly-framework

or yarn:

yarn add butterfly-framework

or even bower:

bower install https://github.com/VTom21/butterfly.git

🌐 Browser Support

Butterfly is designed to work on all modern browsers. It uses built-in utilities and standard CSS features to ensure broad compatibility.

Fully Supported:

  • Chrome (latest)
  • Edge (latest)
  • Firefox (latest)
  • Opera (latest)
  • Safari (latest)

Partial Support:

  • Internet Explorer 11+ — some advanced CSS utilities and JS features may not work fully.

For the best experience, we recommend using modern browsers that support CSS Grid, Flexbox, and ES6+ JavaScript features.

Build elegant, lightweight web apps with Butterfly — Spread Your Wings, Build Faster.