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-vertical-img-txt-archive

v0.73.5

Published

Vertical archive grid: `collection` items with `title`, `text`, `image`, and optional `link` (`type` + `uri`). Clicking a card with a link dispatches `collectionItemClick` and performs `tab` / `page` navigation; `event` link types only emit. CSS parts sty

Readme

hb-vertical-img-txt-archive — integrator guide

Category: content · Tags: content, archive · Package: @htmlbricks/hb-vertical-img-txt-archive

Summary

hb-vertical-img-txt-archive renders a responsive CSS grid of archive cards. Each card stacks an image above a title (h3) and body text (p). Data comes from a single collection value: either an array (when using the element from JavaScript) or a JSON string (typical in HTML).

If collection is missing, empty, not an array, or invalid JSON, the component renders nothing (no placeholder).

Custom element

hb-vertical-img-txt-archive

Data model (collection items)

Each entry in collection matches the Item shape in types/webcomponent.type.d.ts:

| Field | Required | Description | | --- | --- | --- | | title | Yes | Card heading; also used as the image alt text. | | text | Yes | Supporting paragraph under the title. | | image | Yes | Image URL for the card media. | | link | No | Object { type: "tab" \| "page" \| "event"; uri: string }. When present, the whole card is clickable: the component dispatches collectionItemClick, opens tab links in a new window, navigates the document for page, and only notifies the host for event (no built-in navigation). | | subtitle | No | Optional metadata (e.g. date or version); not shown in the current markup. | | index | No | Optional ordering hint for consumers; not used for rendering. |

Example item:

{
  "title": "Release notes",
  "subtitle": "v2.4",
  "text": "Changelog highlights.",
  "image": "https://example.com/card.jpg",
  "link": { "type": "page", "uri": "/releases/2-4" }
}

Attributes (snake_case, string values in HTML)

Web component attributes are strings. Objects and arrays must be JSON-serialized for collection.

| Attribute | Required | Description | | --- | --- | --- | | collection | Yes | JSON array of items (see above). Whitespace-only or invalid JSON logs an error and yields an empty grid. | | id | No | Optional host id (see Component in types/webcomponent.type.d.ts). |

The authoring Component type also lists optional style and size. Layout column count in the current implementation is not driven by size: it is derived from the window width as roughly one column per ~250px of width, capped by the number of items. Optional style may still be useful for host-level styling depending on how your build wires custom-element props; refer to your bundle’s generated typings if you rely on it.

Layout behavior

  • The grid uses grid-template-columns: repeat(N, auto) where N is computed from innerWidth (via svelte:window) and the collection length, so the archive reflows on resize.
  • Cards use full-width images with object-fit: cover inside the image area.

Events

| Event | detail | When | | --- | --- | --- | | collectionItemClick | { uri: string; link_type?: "tab" \| "page" \| "event" } | User activates a card that defines link. |

Styling (Bulma variables)

The component uses Bulma 1.x design tokens on :host and in layout (see Bulma CSS variables). Prefer --bulma-* custom properties for theme alignment.

CSS custom properties (documented in extra/docs.ts)

| Variable | Role | | --- | --- | | --bulma-block-spacing | Gap between cards in the grid. | | --bulma-radius | Corner radius on the image frame. | | --bulma-column-gap | Space between the image block and text block; also used for spacing under the title. | | --bulma-size-5 | Font size for the card title (h3). | | --bulma-text | Color for the description paragraph. | | --bulma-line-height-main | Line height for body text. |

Defaults fall back to sensible literals in styles/webcomponent.scss if a variable is unset.

CSS ::part selectors

| Part | Targets | | --- | --- | | container | Outer grid wrapper (part="container"). | | item | Single card wrapper (part="item"). | | image | The <img> element (part="image"). | | title | The <h3> (part="title"). | | text | The <p> (part="text"). |

Example:

hb-vertical-img-txt-archive::part(title) {
  font-weight: 700;
}

Slots

None (htmlSlots is empty in extra/docs.ts).

Minimal HTML example

<hb-vertical-img-txt-archive
  collection='[{"title":"One","text":"Short description.","image":"https://placehold.co/300x200","link":{"type":"tab","uri":"https://example.com"}}]'
></hb-vertical-img-txt-archive>

Multi-item example (attribute stays on one line in production, or build the string in JS):

<hb-vertical-img-txt-archive
  collection='[{"title":"Alpha","text":"First item.","image":"https://placehold.co/300x200","link":{"type":"event","uri":"open:alpha"}},{"title":"Beta","text":"Second item.","image":"https://placehold.co/300x200","link":{"type":"page","uri":"/beta"}}]'
></hb-vertical-img-txt-archive>

Related files

  • Implementation: component.wc.svelte
  • Authoring types: types/webcomponent.type.d.ts
  • Metadata, Storybook args, and examples: extra/docs.ts
  • Styles: styles/bulma.scss, styles/webcomponent.scss