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

@toolcase/game-components

v3.0.2

Published

Framework-free Web Components for game UIs — HUDs, menus, dialogs, inventories, minimaps, and more, built on Shadow DOM.

Readme

@toolcase/game-components

GitHub npm version

🎮 Framework-free Web Components for game UIs — HUDs, menus, dialogs, inventories, minimaps, settings screens, and more. Built with vanilla HTML5 Custom Elements and Shadow DOM. No React, no Vue, no runtime libraries — just standard browser APIs.

📖 Live demos: toolcase.kalevski.dev/game-components

Why Web Components for game UI?

  • Drop-in anywhere — works in plain HTML, React, Vue, Svelte, Angular, or your custom engine.
  • Style isolation — Shadow DOM keeps game CSS out of your overlay and vice versa.
  • No bundle bloat — components are vanilla classes; tree-shake what you don't use.
  • Works with <canvas> — drop them on top of a Phaser / PixiJS / Three.js canvas.

Install

npm install @toolcase/game-components

Peer dependencies

  • @toolcase/base ^3.x

Setup

import { register } from '@toolcase/game-components'
import '@toolcase/game-components/style.css'

register() // registers every gc-* element on window.customElements

After register() runs, you can use the elements in any HTML — JSX, template literals, frameworks, plain markup.

Usage examples

Plain HTML

<gc-health-bar value="78" max="100"></gc-health-bar>
<gc-ammo-counter current="6" reserve="42"></gc-ammo-counter>
<gc-crosshair style="--crosshair-color: #00ff88;"></gc-crosshair>

React

function GameHUD({ hp, ammo }) {
    return (
        <>
            <gc-health-bar value={hp} max={100} />
            <gc-ammo-counter current={ammo.current} reserve={ammo.reserve} />
        </>
    )
}

If you're on TypeScript + React, declare gc-* in your global JSX namespace, or cast through as any until you generate types.

Vue

<gc-pause-menu></gc-pause-menu>
<gc-volume-slider :value="volume" @change="onVolume"></gc-volume-slider>

On top of a canvas

<style>
    .game { position: relative }
    .game gc-crosshair { position: absolute; inset: 0 }
</style>

<div class="game">
    <canvas id="phaser"></canvas>
    <gc-crosshair></gc-crosshair>
    <gc-health-bar value="80"></gc-health-bar>
    <gc-minimap></gc-minimap>
</div>

Available components

The library ships 130+ ready-made elements covering the full game UI surface:

| Category | Examples | |----------|----------| | Resource bars | gc-health-bar, gc-mana-bar, gc-stamina-bar, gc-ammo-counter, gc-boss-bar, gc-buff-bar | | Crosshair / damage / combat feedback | gc-crosshair, gc-hit-marker, gc-damage-number, gc-combo-counter, gc-kill-feed, gc-screen-flash | | Heads-up display | gc-compass-bar, gc-compass-rose, gc-minimap, gc-objective-marker, gc-waypoint-marker, gc-ping-display, gc-debug-overlay, gc-network-status-icon | | Inventory & items | gc-item-slot, gc-item-tooltip, gc-item-compare, gc-hotbar, gc-inventory-grid, gc-equipment-doll, gc-loot-list, gc-loot-popup, gc-rarity-chip, gc-currency-chip, gc-currency-display | | Player / social | gc-player-card, gc-player-frame, gc-portrait, gc-friends-list, gc-mute-list, gc-party-panel, gc-guild-panel, gc-chat-window, gc-invite-toast, gc-report-player-dialog | | Menus & screens | gc-main-menu, gc-pause-menu, gc-pause-screen, gc-loading-screen, gc-loading-overlay, gc-title-screen, gc-result-screen, gc-game-over-screen, gc-victory-screen, gc-stats-screen, gc-matchmaking-screen | | Dialogues & prompts | gc-dialogue-box, gc-confirm-dialog, gc-interact-prompt, gc-press-any-key | | Progression & quests | gc-quest-tracker, gc-skill-tree, gc-skill-bar, gc-ability-card, gc-perk-picker, gc-codex, gc-journal, gc-achievement-list, gc-battle-pass | | Economy | gc-shop-panel, gc-crafting-panel, gc-radial-wheel | | Lobby & matchmaking | gc-lobby, gc-character-create, gc-character-select, gc-level-select, gc-save-slot-list | | Settings | gc-fov-slider, gc-deadzone-slider, gc-volume-slider, gc-mouse-sensitivity, gc-fps-cap-select, gc-graphics-preset-picker, gc-vsync-toggle, gc-fullscreen-toggle, gc-invert-axis-toggle, gc-brightness-calibration, gc-controls-rebind-list, gc-key-binder, gc-controller-layout-preview, gc-reset-to-defaults, gc-settings-category-list | | Layout | gc-stack, gc-grid, gc-anchor, gc-panel, gc-panel-header, gc-divider, gc-tab-bar, gc-page-indicator, gc-safe-area, gc-aspect-ratio-box, gc-letterbox-bars | | Typography & decoration | gc-title, gc-subtitle, gc-eyebrow, gc-lore-text, gc-scroll-text, gc-version-label, gc-icon-badge, gc-gilded-frame, gc-rune-corner, gc-artboard-backdrop, gc-vignette-overlay, gc-blur-overlay | | Buttons & inputs | gc-metal-button, gc-nav-button, gc-menu-item, gc-list-row, gc-toggle, gc-toggle-row, gc-select-row, gc-stat-row, gc-key, gc-gamepad-button-prompt, gc-platform-icon, gc-check, gc-combo-box | | Effects | gc-shake-container, gc-transition-wipe, gc-particle-emitter, gc-cooldown-badge, gc-circular-progress | | Vehicle / driving HUD | gc-speedometer | | Credits / legal | gc-credits-list, gc-credits-scroll, gc-legal-screen | | Buffs | gc-buff-icon |

Full per-component API (attributes, slots, events, CSS variables) lives at toolcase.kalevski.dev/game-components/SKILL.md.

Theming

Each component uses Shadow DOM, so global CSS doesn't leak in or out. Customize via CSS custom properties on the host:

gc-health-bar {
    --hp-fill: linear-gradient(90deg, #ff3a3a, #ff8a3a);
    --hp-bg: rgba(0, 0, 0, .6);
    --hp-height: 18px;
}

gc-crosshair {
    --crosshair-color: #00ff88;
    --crosshair-thickness: 2px;
}

Or rebuild from SCSS:

$panel-bg: #0c0e14;
@import '@toolcase/game-components/style/index.scss';

License

MIT