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

@htmlbricks/hb-area-code

v0.76.5

Published

Frameless code area (no Bulma `box`): copy + optional success tag floated top-right over the `<pre><code>` snippet; `:host` and root wrapper have no margin or padding. Copy dispatches `clipboardCopyText` with `{ text }`. Theme follows `bulma-wc-host-theme

Readme

hb-area-code

Category: utilities · Tags: utilities, developer

Summary

hb-area-code renders content in a frameless root (no Bulma box): copy + optional “Copied” tag are positioned top-right over the <pre><code> snippet. Copy uses navigator.clipboard.writeText and emits clipboardCopyText with { text }. The host and root wrapper have no extra margin or padding; spacing around the snippet is up to the parent or ::part(content).

Behaviour

  1. Copy: each click writes content to the clipboard, shows confirmation (~1.6s, timer resets on repeat), and dispatches clipboardCopyText with detail.text.
  2. content: single source for display and clipboard.
  3. id: optional; when set, it is applied to the root hb-area-code wrapper inside the shadow tree.

Markup

  • Root: hb-area-code (no box / outer card frame; no margin or padding on the host root wrapper).
  • Wrapper hb-area-code-body (position: relative): floating hb-area-code-float (absolute top-right) with optional tag is-success is-size-7, then button is-small (theme-default fill, no is-light) with Bootstrap Icons bi-clipboard / bi-clipboard-check.
  • Snippet: <pre part="content" class="hb-area-code-snippet"> and <code class="hb-area-code-snippet-code"> (uniform insets; extra padding-inline-end keeps long first lines clear of the copy controls).

Custom element

hb-area-code

Attributes

| Attribute | Notes | | --- | --- | | content | Shown in the snippet and copied (string). | | id | Optional string on the inner root hb-area-code element. |

Events

| Event | detail | | --- | --- | | clipboardCopyText | { text: string } |

Styling

  • Parts: content<pre> (see extra/docs.ts).
  • Theme: same stack as other hb-* components (bulma-wc-host-theme-tokens on the shadow :host): system prefers-color-scheme, then data-theme / .theme-* on html, body, or the custom element host. color-scheme on the host follows that order so native chrome stays coherent. The snippet background and border are built with hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), var(--bulma-scheme-main-bis-l)) and border-l primitives so the surface stays valid in the shadow tree; text prefers --bulma-text with the same hsl(…, --bulma-text-l) fallback.
  • Corners: snippet, copy button, and tag use border-radius: 0 (no rounded corners inside this component).
  • Dark mode: the default strip follows Bulma tokens on the shadow :host (system prefers-color-scheme is handled by bulma-wc-host-theme-tokens, so main-bis-l is already a dark gray on a dark scheme). The deeper “well” (scheme-main-l, border-l, inset highlight) applies only when dark is explicitdata-theme="dark" or .theme-dark on html, body, or the host — so we never mix OS dark with light-token scheme-main-l (that would read as white).

TypeScript

types/webcomponent.type.d.ts

Example

<hb-area-code content="npm install @htmlbricks/hb-area-code"></hb-area-code>