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

v0.1.0

Published

Use Astro components inside Slidev slides via the Astro Container API.

Readme

astro-slidev

Use Astro components inside Slidev slides, via the experimental Astro Container API.

.astro files are rendered to static HTML at module-load time and surfaced as Vue components, so they can be referenced from a slide just like any other component.

Install

pnpm add -D astro-slidev astro

astro is a peer dependency. vue and vite are also peers and are normally already provided by Slidev.

Setup

Register the Vite plugin in vite.config.ts:

import { defineConfig } from "vite";
import astroSlidev from "astro-slidev";

export default defineConfig({
  // `slidev` is a Slidev-specific Vite config extension.
  // @ts-expect-error Vite's base config type does not know about it.
  slidev: {
    components: {
      extensions: ["vue", "astro"],
    },
  },
  plugins: [astroSlidev()],
});

Place a .astro file under ./components/ and reference it from a slide by its filename:

# Slide

<MyComponent />

What works

  • Frontmatter scripts and expression interpolation ({value}, .map(...) in markup)
  • TypeScript syntax in the frontmatter (interface, type annotations, as casts) — types are stripped via Vite's oxc transform before the module is loaded
  • Scoped <style> blocks — emitted CSS chunks are routed through Vite's CSS pipeline and participate in HMR
  • HMR on .astro source changes (including transitive .astro deps)
  • .astro importing another .astro (e.g. import Card from "./Card.astro"), with paths resolved through Vite's resolver (so aliases / tsconfig paths work)

Limitations

  • No framework integrations. Renderers for React / Vue / Svelte / Solid / Preact islands are not registered on the container, so components that depend on them fail to render. By extension, client:load / client:idle / client:visible directives — which only apply to framework islands — aren't usable either.
  • No prop pass-through from slides. A .astro file is rendered once at module-load time with empty props, so attributes written on the component tag in a slide (e.g. <Greeting name="World" />) don't reach Astro.props. Frontmatter constants and Astro-side defaults work as usual.
  • Container API is experimental upstream and may break across Astro minor/patch releases.

How it works

  1. @astrojs/compiler transforms the entry .astro (and its transitive .astro deps, resolved via Vite) to JS modules.
  2. Each module is run through Vite's oxc transform to strip TypeScript syntax (the Astro compiler preserves frontmatter verbatim, so interface / type annotations would otherwise reach Node's ESM loader as-is).
  3. Each module is written into a per-render session directory under node_modules/.astro-slidev/ with .astro → .astro imports rewritten to sibling .mjs files, then the entry is dynamically imported. Bare-specifier imports (astro/runtime/server/index.js etc.) resolve through the project's normal node resolution.
  4. experimental_AstroContainer.renderToString produces an HTML string.
  5. The plugin emits a Vue component that renders that HTML via innerHTML.
  6. Scoped CSS chunks reported by the compiler — across the entry and its deps — are exposed as virtual .css modules and side-effect-imported from the generated component.
  7. Dep .astro files are registered with addWatchFile, so editing a child .astro invalidates the entry and triggers HMR.