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-dropdown-notifications

v0.76.5

Published

Bell control that toggles a Bulma `dropdown` (`is-active`): header row with optional “Clear all” (`clearurl`), default slot for notification rows, and optional footer “View all” (`viewurl`). `align` applies `is-right` on the dropdown for end alignment.

Readme

hb-dropdown-notifications — dropdown-notifications

Package: @htmlbricks/hb-dropdown-notifications
Category: overlays
Tags: overlays, menu, notifications

What it does

hb-dropdown-notifications is a notification menu built as a Bulma dropdown: a bell trigger toggles the is-active state on the root dropdown. The panel includes a fixed “Notifications” header, an optional “Clear all” link when clearurl is non-empty, a default slot for your notification rows, and an optional “View all” footer when viewurl is non-empty. Set align to right to add Bulma’s is-right class so the menu aligns toward the end of the bar (typical for navbar-end placement).

Behavior notes for integrators:

  • Open state is toggled only by clicking the bell button (aria-expanded updates accordingly). There is no built-in document click-outside handler; closing after navigation or custom UX is up to the host page or a wrapper.
  • “Clear all” and “View all” are plain <a href="…"> links; they do not emit custom events (the public Events type is empty).

Custom element

hb-dropdown-notifications

Attributes (snake_case; string values in HTML)

Web component attributes are strings. Align with your HTML Bricks / build conventions for optional empty strings.

| Attribute | Required | Description | | --- | --- | --- | | id | No | Optional element identifier (see your generated typings for host binding). | | style | No | Optional inline style string for host-level styling (declared on the Component type). | | clearurl | No | URL for Clear all. If empty or omitted, the link is not rendered. | | viewurl | No | URL for View all. If empty or omitted, the footer block (divider + link) is not rendered. | | align | No | left or right (default left). right applies is-right on the dropdown. |

In HTML, pass attributes as strings; use "" for URLs you want omitted.

Events

None. The component does not declare custom events on its public Events type.

Accessibility

The bell control is a <button type="button"> with:

  • aria-label="Notifications menu"
  • aria-haspopup="true"
  • aria-expanded bound to open state
  • aria-controls="dropdown-notifications-menu" pointing at the menu container (role="menu")

Ensure slotted items are keyboard-focusable and labeled appropriately if they are interactive.

Styling (CSS custom properties)

Theme the panel and chrome with Bulma variables on :host. Optional helpers support muted text inside slotted markup when you use rgba(var(--x-muted-rgb), var(--x-text-opacity)) patterns.

| Variable | Role | | --- | --- | | --bulma-scheme-main | Background of the dropdown panel (dropdown-content). | | --bulma-border | Dividers and menu borders. | | --bulma-text | Header label and default body text in the panel. | | --bulma-link | “Clear all” / “View all” link color. | | --x-muted-rgb | Comma-separated RGB triplet (e.g. 115, 130, 140) for muted slotted copy. | | --x-text-opacity | Opacity multiplier (typically 01) paired with --x-muted-rgb. |

See Bulma CSS variables for the full theme map.

CSS ::part

None. Style via host custom properties, Bulma classes on slotted nodes, and global Bulma utilities as needed.

Slots

| Slot | Description | | --- | --- | | (default) | Content between the fixed Notifications header and the optional View all footer. Place each notification as a Bulma dropdown-item (or equivalent) for correct spacing. The title row and footer links are not slotted. |

Integration patterns

  1. Rows in the default slot — wrap each entry in dropdown-item (and optional is-active / media / text utilities) so spacing matches Bulma’s dropdown content.
  2. Footer off — omit meaningful URLs by setting clearurl and/or viewurl to empty strings so those sections disappear.
  3. Navbar end — use align="right" so the menu does not overflow off the right edge of the viewport.

Minimal HTML example

<hb-dropdown-notifications
  clearurl=""
  viewurl="/notifications"
  align="right"
>
  <div class="dropdown-item">Sample notification</div>
</hb-dropdown-notifications>

Example with both footer actions

<hb-dropdown-notifications
  clearurl="/api/notifications/clear"
  viewurl="/notifications"
  align="left"
>
  <a href="/notifications/1" class="dropdown-item">Order #1024 shipped</a>
  <a href="/notifications/2" class="dropdown-item">New message from support</a>
</hb-dropdown-notifications>