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

@prosefly/astro-components

v0.9.0

Published

Reusable Astro components for MDX content.

Readme

@prosefly/astro-components

Reusable Astro components for MDX content.

Prosefly natively supports these components in its visual editor, so authors can create and edit content with Prosefly components visually.

Install

Install the package in an Astro v7 project:

pnpm add @prosefly/astro-components

If your site renders .mdx pages, make sure MDX is configured in Astro first. Dahlia and Lotus projects already include MDX, the shared integration, icon preloading, and their docs shell.

---
import { Callout } from '@prosefly/astro-components';
---

<Callout type="tip" title="Reusable">
  Package components use Prosefly CSS custom properties with built-in fallbacks.
</Callout>

Full documentation is available at astro-components.prosefly.dev.

Shared integration

For a standalone Astro site, register @prosefly/astro-components/integration to configure icon preloading, shared Markdown transforms, and their styles and client runtimes together:

import { defineConfig } from 'astro/config';
import proseflyComponents from '@prosefly/astro-components/integration';

export default defineConfig({
  integrations: [proseflyComponents()],
});

Exports

The main entry exports:

  • AccordionItem and Accordions
  • AudioPlayer
  • Badge
  • Callout
  • Card and CardGrid
  • FileTree
  • Icon
  • ImageGallery
  • Steps
  • TabItem and Tabs
  • VideoPlayer

The /integration entry exports the proseflyComponents() Astro integration and its ComponentsIntegrationOptions type.

The markdown entry exports:

  • rehypeMermaid
  • rehypeVideoPlayer
  • remarkImageGallery
  • remarkPackageManagerTabs

Advanced icon-only setup

Use /integration for the usual setup. The standalone @prosefly/astro-components/icon entry remains available when a project wants only Iconify preloading without Markdown transforms or the full Dahlia or Lotus theme:

import { defineConfig } from 'astro/config';
import proseflyIcon from '@prosefly/astro-components/icon';

export default defineConfig({
  integrations: [
    proseflyIcon({
      preload: ['lucide:star', 'simple-icons:github'],
    }),
  ],
});

The integration can scan src/**/*.astro, src/**/*.md, and src/**/*.mdx for static icon usage. Set scan: false to disable that behavior or apiBase to point at an internal Iconify-compatible endpoint.

Independent Markdown transforms

Use /integration for the normal Markdown setup. It enables callouts, package-manager tabs, image galleries, and video figures in both .md and .mdx files. The @prosefly/astro-components/markdown entry remains available for advanced processor composition:

import { defineConfig } from 'astro/config';
import {
  rehypeMermaid,
  remarkImageGallery,
  remarkPackageManagerTabs,
  unified,
} from '@prosefly/astro-components/markdown';

export default defineConfig({
  markdown: {
    syntaxHighlight: {
      type: 'shiki',
      excludeLangs: ['math', 'mermaid'],
    },
    processor: unified({
      remarkPlugins: [remarkImageGallery, remarkPackageManagerTabs],
      rehypePlugins: [rehypeMermaid],
    }),
  },
});

remarkPackageManagerTabs recognizes common npm commands and can generate tabs for Node and Python package managers. remarkImageGallery generates gallery HTML in Markdown and MDX while preserving the original image nodes for Astro optimization. Use proseflyComponents() to load gallery CSS and runtime automatically. rehypeMermaid renders mermaid code blocks as static SVG; direct use requires excluding mermaid from Astro syntax highlighting. Dahlia and Lotus enable these transforms through the shared integration by default.

VideoPlayer loops short clips silently while visible and uses native controls for long videos. proseflyComponents() enables automatic video-figure conversion in Markdown and MDX by default, including when registered by Dahlia or Lotus. Disable it with proseflyComponents({ markdown: { videoPlayer: false } }), or register rehypeVideoPlayer directly when not using the integration. Both accept { shortVideoSeconds: 30, labels: { play: 'Play' } } configuration (via markdown.videoPlayer for the integration). HTML attributes, sources, tracks, and rich captions are preserved, and no media is fetched at build time. Audio and mixed-content figures are unchanged. Automatic transforms generate HTML without importing Astro components; the shared integration loads their styles and browser runtimes.

Independent Expressive Code plugin

Expressive Code is intentionally separate from proseflyComponents(). Install astro-expressive-code and register expressiveCodeHeaderIcons() in its plugins option:

pnpm add astro-expressive-code
import { defineConfig } from 'astro/config';
import astroExpressiveCode from 'astro-expressive-code';
import { expressiveCodeHeaderIcons } from '@prosefly/astro-components/expressive-code';

export default defineConfig({
  integrations: [
    astroExpressiveCode({
      plugins: [expressiveCodeHeaderIcons()],
    }),
  ],
});

Pass { apiBase: 'https://example.com' } to use an Iconify-compatible endpoint for code-header icons. Dahlia and Lotus already configure this plugin; do not register it a second time in those themes.

The /expressive-code entry publicly exports only expressiveCodeHeaderIcons and the ExpressiveCodeHeaderIconsOptions type. The icon and language-label helpers used by the plugin are internal.

Local Development And Publishing

Workspace exports point to src, so pnpm dev runs the documentation site directly against the components and TypeScript source with hot reload. It does not require a package build first. Local site builds also consume source.

pnpm test builds and tests dist, then packs the package and verifies its published entry points. pnpm pack and pnpm publish override exports and types using publishConfig; only dist, the README, and license are shipped. The prepack hook builds the package automatically.

Use pnpm to pack or publish from the source checkout. If publishing with npm (for example, for trusted publishing), first create a tarball with pnpm pack, then run npm publish ./prosefly-astro-components-<version>.tgz. Do not run npm publish directly against the source directory: npm does not apply these manifest overrides.

Styling

Consumers can theme the components with --pf-* custom properties:

  • --pf-text-strong
  • --pf-text
  • --pf-text-muted
  • --pf-background
  • --pf-surface
  • --pf-accent
  • --pf-accent-soft
  • --pf-accent-contrast
  • --pf-{info|success|warning|danger}
  • --pf-{info|success|warning|danger}-soft
  • --pf-{info|success|warning|danger}-ink
  • --pf-{info|success|warning|danger}-contrast
  • --pf-callout-{note|tip|warning|danger}-{color|ink|bg}
  • --pf-border-subtle
  • --pf-font-sans
  • --pf-font-mono
  • --pf-radius-sm
  • --pf-radius-md
  • --pf-radius-lg
  • --pf-radius-full