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-docs

v0.1.0

Published

A customizable documentation and book framework for Astro. Bring your own look.

Downloads

163

Readme

astro-docs

A documentation and book framework for Astro — with Starlight-class features and one defining difference: the docs look like your site, not like the framework.

Framework styles live entirely in CSS cascade layers, so your own stylesheet always wins. Zero client JavaScript by default.

Features

  • Config-driven sidebar with autogenerate from your content directory
  • Search via Pagefind (static index, lazy modal UI)
  • Table of contents, breadcrumbs, prev/next pagination
  • Callouts:::note directives and GitHub-style > [!NOTE]
  • Expressive Code code blocks (titles, line markers, copy button)
  • Book mode — parts/chapters, numbered sections & figures, @fig/@sec cross-references, KaTeX math
  • Component overrides — swap any UI component
  • Bring your own CSS — layered defaults, unlayered overrides
  • Dark mode — opt-in, with a no-flash inline script
  • Sitemap, edit links, i18n-ready

Install

npm install astro-docs

Quick start

1. Add the integration

// astro.config.mjs
import { defineConfig } from "astro/config";
import astroDocs from "astro-docs";

export default defineConfig({
  integrations: [
    astroDocs({
      title: "My Docs",
      collections: {
        docs: { kind: "docs", base: "/docs" },
      },
    }),
  ],
});

2. Define the content collection

// src/content.config.ts
import { defineCollection } from "astro:content";
import { docsLoader } from "astro-docs/loaders";
import { docsSchema } from "astro-docs/schema";

export const collections = {
  docs: defineCollection({ loader: docsLoader(), schema: docsSchema }),
};

3. Write Markdown

Drop files into src/content/docs/. They become pages automatically — no route files to write.

---
title: Getting Started
sidebar:
  order: 1
  badge: New
---

## Install
...

That's it. The integration injects the routes, builds the sidebar, and renders each page.

Configuration

| Option | Type | Default | Description | | --- | --- | --- | --- | | title | string | required | Site title | | description | string | — | Default meta description | | collections | Record<string, { kind, base, sidebar? }> | { docs: { kind: "docs", base: "/" } } | Mounted collections | | sidebar | SidebarItem[] | autogenerate | Global sidebar (per-collection override available) | | theme | "paper" \| "none" \| string | "paper" | Built-in preset, none, or a CSS path | | colorScheme | "light" \| "dark" \| "both" | "light" | Dark mode (emits JS only when not "light") | | customCss | string[] | [] | Your stylesheets — imported unlayered, so they win | | tableOfContents | boolean \| { minHeadingLevel, maxHeadingLevel } | 2–3 | Right-rail TOC | | pagination | boolean | true | Prev/next links | | editLink | { baseUrl } | — | "Edit this page" links | | lastUpdated | boolean | false | Show last-updated date (from frontmatter) | | social | Array<{ icon, label, href }> | [] | Header social links | | components | Record<Name, path> | {} | Override built-in components | | expressiveCode | boolean \| object | true | Code block rendering | | pagefind | boolean \| object | true | Search index | | math | boolean | false | KaTeX math ($…$, $$…$$) |

Sidebar

sidebar: [
  { slug: "index", label: "Introduction" },
  { label: "Guides", autogenerate: { directory: "guides" } },
  {
    label: "Reference",
    items: [
      { slug: "reference/cli" },
      { label: "External", link: "https://example.com", badge: "↗" },
    ],
  },
]
  • A bare string or { slug } is an internal link (label falls back to the page title).
  • { label, link } is a manual/external link.
  • { label, items } is a group.
  • { label?, autogenerate: { directory } } builds items from a directory.

A directory's own index page becomes a leading link; subdirectories become collapsible groups.

Theming (bring your own look)

Three tiers, in increasing power:

  1. Override tokens — set --docs-* variables in your customCss:
    :root {
      --docs-color-accent: #b8460e;
      --docs-font-body: "Inter", sans-serif;
      --docs-sidebar-width: 18rem;
    }
  2. Restyle components — target the stable .docs-* classes. Your unlayered CSS beats the framework's layered defaults automatically.
  3. Replace the presettheme: "none" ships zero skin, or point theme at your own CSS file.

Component overrides

astroDocs({
  title: "My Docs",
  components: {
    Header: "./src/overrides/Header.astro",
    Footer: "./src/overrides/Footer.astro",
  },
})

Overridable: Head, ThemeProvider, SkipLink, PageFrame, Header, SiteTitle, Logo, Search, SocialIcons, ThemeSelect, Sidebar, TableOfContents, MobileTableOfContents, Banner, Breadcrumbs, PageTitle, MarkdownContent, Footer, LastUpdated, Pagination, EditLink, Callout.

Your component reads the current page via Astro.locals.astroDocs (see astro-docs/typesRouteData).

Book mode

Mount a collection with kind: "book" and use the bookLoader + bookSchema:

import { bookLoader } from "astro-docs/loaders";
import { bookSchema } from "astro-docs/schema";

export const collections = {
  book: defineCollection({ loader: bookLoader(), schema: bookSchema }),
};

Book frontmatter adds chapter and numberSections:

---
title: Foundations
chapter: 1
numberSections: true
---

We refer back to @fig-overview and forward to @sec-scaling.

:::figure[The system overview.]{#overview}
![Overview](./overview.png)
:::

$$
T(n) = a \cdot n \log n + b
$$
  • Headings are numbered (1.1, 1.2, …) when numberSections is set.
  • :::figure{#id} / :::table{#id} are numbered.
  • @fig-id, @sec-id, @tbl-id resolve to numbered links at build time.

Callouts

In Markdown:

> [!WARNING]
> This is a warning.

:::tip
A tip with the default title.
:::

:::note[Custom title]
A note with a custom title.
:::

In MDX:

import { Callout } from "astro-docs/components";

<Callout type="danger" title="Careful">Don't do this.</Callout>

Exports

  • astro-docs — the integration (default export)
  • astro-docs/loadersdocsLoader, bookLoader
  • astro-docs/schemadocsSchema, bookSchema, config/sidebar schemas
  • astro-docs/componentsCallout, Page, and individual components
  • astro-docs/typesRouteData, ResolvedSidebarItem, and more

License

MIT © Shravan Goswami