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

@litforge/icon-button

v0.1.22

Published

An icon-only button component with variants, sizes, loading state, and accessibility support, built with Lit.

Readme

@litforge/icon-button

An icon-only button component with variants, sizes, loading state, and accessibility support, built with Lit.

Overview

The IconButton component provides a button that displays only an icon (or uses a slot for custom content) with support for different variants, sizes, loading states, and full accessibility.

Installation

npm install @litforge/icon-button
# or
pnpm add @litforge/icon-button
# or
yarn add @litforge/icon-button

Basic Usage

<script type="module">
  import '@litforge/icon-button';
</script>

<icon-button icon="✏️" label="Edit" @icon-button-click=${handleClick}></icon-button>

Properties

| Property | Type | Default | Description | |----------|------|---------|-------------| | icon | string | '' | Icon character or emoji | | label | string | '' | Accessibility label (aria-label) | | variant | 'primary' \| 'secondary' \| 'danger' \| 'ghost' | 'ghost' | Button variant | | size | 'sm' \| 'md' \| 'lg' | 'md' | Button size | | disabled | boolean | false | Disabled state | | loading | boolean | false | Loading state with spinner |

Events

icon-button-click

Fired when the button is clicked.

Detail: { originalEvent: MouseEvent }

Examples

Basic Icon Button

<icon-button icon="✏️" label="Edit" @icon-button-click=${handleEdit}></icon-button>

Variants

<icon-button icon="✏️" variant="primary" label="Edit"></icon-button>
<icon-button icon="🗑️" variant="danger" label="Delete"></icon-button>
<icon-button icon="👁️" variant="secondary" label="View"></icon-button>
<icon-button icon="⚙️" variant="ghost" label="Settings"></icon-button>

Sizes

<icon-button icon="✏️" size="sm" label="Edit"></icon-button>
<icon-button icon="✏️" size="md" label="Edit"></icon-button>
<icon-button icon="✏️" size="lg" label="Edit"></icon-button>

Loading State

<icon-button icon="💾" label="Save" loading></icon-button>

With Custom Content (Slot)

<icon-button label="Custom" variant="primary">
  <svg width="16" height="16">...</svg>
</icon-button>

Styling

The component uses CSS variables for theming:

icon-button {
  --lf-icon-button-radius: 8px;
  --lf-icon-button-padding: 8px;
  --lf-icon-button-color: #111827;
  --lf-icon-button-primary-bg: #0b6efd;
  --lf-icon-button-primary-color: #ffffff;
  /* ... more variables */
}

TypeScript

import { IconButton, IconButtonVariant, IconButtonSize } from '@litforge/icon-button';

Accessibility

  • Always provide a label prop for accessibility (used as aria-label)
  • The button is keyboard accessible
  • Loading state sets aria-busy="true"
  • Disabled state properly prevents interaction

License

Part of the LitForge component library.