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

@adaptive-sm/astro-ui

v0.4.0

Published

A library of reusable UI components for Astro projects. Built with TypeScript, Tailwind CSS, and Astro in static output mode. Components are designed to be accessible, customizable, and easy to integrate.

Readme

Adaptive Astro UI

A library of reusable UI components for Astro projects. Built with TypeScript, Tailwind CSS, and Astro in static output mode. Components are designed to be accessible, customizable, and easy to integrate.

Quick link

  • code - https://github.com/adaptive-shield-matrix/astro-ui
  • npm - https://www.npmjs.com/package/@adaptive-sm/astro-ui
  • component demo - https://adaptive-astro-ui.pages.dev/

Installation

Install the package using Bun:

bun add @adaptive-sm/astro-ui

Tailwind CSS Configuration

To ensure Tailwind scans the library's source files for classes (since components are published as source without a build step), add the following @source directive to your project's src/layouts/tailwind.css (or equivalent global stylesheet):

@source '/node_modules/@adaptive-sm/astro-ui/lib/**/*.{astro,html,md,mdx,ts,tsx}';

This tells Tailwind to include classes from the library's .astro, .ts, and other relevant files in the purge process, preventing unused classes from being purged during the build. Without it, Tailwind might not detect classes used in imported components, leading to missing styles.

Option configuration: import alias

Typescript

In your tsconfig.json, set up the ~ alias to point to the library:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "~ui/*": ["node_modules/@adaptive-sm/astro-ui/lib/*"]
    }
  }
}

Astro

In your astro.config.mjs, set up the ~ alias to point to the library:

import { defineConfig } from "astro/config"

export default defineConfig({
  vite: {
    resolve: {
      alias: {
        "~": new URL("./node_modules/@adaptive-sm/astro-ui/lib", import.meta.url).pathname,
      },
    },
  },
})

Usage

No Build Step Required

This library ships source .astro and .ts files directly—no pre-build needed. Benefits include:

  • Smaller size: No bundled or compiled files.
  • Full compatibility: Your Astro project compiles components using its own Astro, Vite, and Tailwind setup.
  • Better DX: Preserves TypeScript types and IntelliSense.
  • Easier updates: Consumers get changes immediately, with no build artifacts to manage.

Just set up your alias - Astro handles the rest automatically.

Import and use components directly in your Astro files. For example:

Button Component

---
import { Button } from "~ui/button/Button.astro"
---

<Button variant="primary">Click me</Button>

Card Component

---
import { CardWrapper } from "~ui/card/CardWrapper.astro"
---

<CardWrapper> Card content here. </CardWrapper>

Image Component

---
import { Img } from "~ui/img/Img.astro"
---

<Img src="/path/to/image.jpg" alt="Description" />

Refer to individual component documentation in the source code for props and variants.

Components

Buttons

  • Button.astro
  • Button variants and animations via CVAs in buttonCva.ts, buttonIconCva.ts

Cards

Details

Forms

Icons

usage:

  • Choose from over 7000 icons: https://pictogrammers.com/library/mdi/
  • Import name from "@mdi/js" library
  • Passed on as path prop

Images

  • Img.astro

    A small wrapper setting loading lazy and decoding to async.

  • TypedImg.astro

    An image with given width and height to prevent layout shifts.

    Generate types using lib/generate_image_list/generateImageList.ts

Layouts

Navigation bar

Links

Lists

Modals

Pages

Popovers

Selects

Table

Demos

Explore component demos at: https://adaptive-astro-ui.pages.dev/

Development

Building the Library

bun run build

Running Demos

bun run dev

Linting and Formatting

Uses Biome for linting and formatting:

bun run biome check .
bun run biome format --write .

Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Add or update components in lib/.
  4. Update demos in src/pages/demos/.
  5. Ensure tests pass and run bun run build.
  6. Submit a pull request.

Follow the coding rules in .roo/rules-code/ for style and best practices.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

For more information, visit the GitHub repository.