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

starlight-page-context-action

v0.2.0

Published

A Starlight plugin that adds page action buttons to the right sidebar above the table of contents.

Readme

starlight-page-context-action

A Starlight plugin that adds page action buttons to the right sidebar — making utility actions like copy page, open in AI chat, and scroll to top always accessible alongside the table of contents.

Demo & Docs

Features

  • Copy Page — Copies the raw markdown content to clipboard with visual feedback
  • Open in AI Chat — Dropdown to open the current page in ChatGPT, Claude, or T3 Chat with a customizable prompt
  • Scroll to Top — Smooth scroll back to the top of the page
  • Mobile Support — Compact "Page Actions" dropdown in the mobile table of contents bar
  • Zero Config — Works out of the box with sensible defaults
  • Per-Page Control — Disable actions on specific pages via frontmatter
  • Two Layouts — Choose between a spread (vertical list) or compact (pill + kebab menu) layout
  • Fully Themed — Inherits Starlight's CSS variables with automatic light/dark mode support

Installation

npm install starlight-page-context-action

Getting Started

Add the plugin to your Starlight config in astro.config.mjs:

import starlight from "@astrojs/starlight";
import { defineConfig } from "astro/config";
import starlightPageContextAction from "starlight-page-context-action";

export default defineConfig({
  integrations: [
    starlight({
      title: "My Docs",
      plugins: [starlightPageContextAction()],
    }),
  ],
});

That's it — all actions are enabled by default and appear above the table of contents.

Configuration

Pass a config object to customize behavior:

starlightPageContextAction({
  prompt: "Read {url}. I want to ask questions about it.",
  position: "above-toc",
  layout: "spread",
  sticky: false,
  actions: {
    copy: true,
    chatgpt: true,
    claude: true,
    t3chat: true,
    scrollTop: true,
  },
});

Options

| Option | Type | Default | Description | | ---------- | ------------------------------ | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- | | prompt | string | "Read {url}. I want to ask questions about it." | Prompt template for AI services. {url} is replaced with the current page URL. | | position | "above-toc" | "below-toc" | "above-toc" | Position of the actions relative to the table of contents. | | layout | "spread" | "compact" | "spread" | Layout style. "spread" shows all buttons vertically. "compact" shows a primary copy button inline with a kebab menu for AI actions. | | sticky | boolean | false | Whether the actions stick to the top/bottom of the sidebar on scroll. | | actions | object | All true | Toggle individual action buttons on or off. |

Disabling on a Specific Page

Add pageContextActions: false to the page's frontmatter:

---
title: My Page
pageContextActions: false
---

Peer Dependencies

  • astro >= 5.0.0
  • @astrojs/starlight >= 0.36.0

License

MIT