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

astro-better-cards

v1.0.1

Published

Components for cards and navigation in Astro documentation sites.

Downloads

1,655

Readme

astro-better-cards

Components for cards and navigation in Astro documentation sites.

Card

A single card with three display variants.

import Card from 'astro-better-cards/Card.astro';

<Card
  href="/docs/section/page"
  title="Page Title"
  description="Optional description text."
  icon="/img/icons/example.svg"
  variant="full"
/>

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | href | string | required | Link destination | | title | string | required | Card title (HTML allowed) | | description | string | — | Subtitle text | | icon | string | — | Icon image URL (light mode) | | darkIcon | string | — | Icon image URL (dark mode) | | cardImage | string | — | Hero image URL | | variant | 'full' \| 'compact' \| 'quickstart' | 'full' | Display style | | comingSoon | boolean | false | Greys out the card | | label | string | — | Small label text | | labelFirst | boolean | false | Render label before title | | version | string | — | Version string shown below the title | | badges | string[] | — | Badge labels shown beside the version |

ChildCards

Automatically renders cards for child pages of the current section, pulled from an Astro content collection.

import ChildCards from 'astro-better-cards/ChildCards.astro';

<!-- direct children of the current page's folder -->
<ChildCards />

<!-- grandchildren grouped by subfolder with section headers -->
<ChildCards depth={2} />

<!-- deeper nesting (up to 4) with h2/h3/h4 section headers -->
<ChildCards depth={4} />

<!-- explicit folder, 3 columns -->
<ChildCards folder="get-started/quickstarts" columns={3} />

<!-- children from a different collection -->
<ChildCards collection="articles" />

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | collection | string | 'docs' | Astro content collection name | | folder | string | current page folder | Collection-relative path (get-started/foo), URL-absolute path (/docs/get-started/foo), or relative path (./sub, ../other) | | depth | 1 \| 2 \| 3 \| 4 | 1 | 1 = direct children; 2-4 = deeper pages grouped under section headers (h2, then h3, then h4) | | columns | 1 \| 2 \| 3 \| 4 | 2 | Number of columns in the card grid |

Pages with excludeFromNav: true or route: false are excluded.

PageNav

Renders previous/next navigation links at the bottom of a page. Reads prev and next from the current page's frontmatter and resolves titles automatically from the collection. Prop values override frontmatter when both are present.

Add prev and next to the page's frontmatter:

prev: "step-1"
next: "step-3"

Then use the component with no props:

import PageNav from 'astro-better-cards/PageNav.astro';

<PageNav />

Or override frontmatter on a specific instance:

<PageNav prev="other-page" next="another-page" />

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | collection | string | 'docs' | Astro content collection name | | prev | string | frontmatter prev | Path to the previous page (relative filename, collection-relative, or absolute /) | | next | string | frontmatter next | Path to the next page |