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

@nuasite/components

v0.9.3

Published

Nua Site astro components.

Readme

@nuasite/components

Reusable Astro components optimized for sites connected to Nua Site. The package currently ships:

  • Form: Progressive enhancement for Nua Site form submissions with friendly UI states.
  • Image: Ergonomic Cloudflare Image Transform helper that builds /cdn-cgi/image/<options>/<src> URLs and responsive srcset.

Install

bun add @nuasite/components

The package targets Astro projects and expects typescript@^5 to be available in your workspace (peer dependency).

Usage

Form

---
import { Form } from '@nuasite/components'
---

<Form
  action="/contact"
  successMessage="Thanks—we'll be in touch!"
  submittingMessage="Sending..."
  errorMessage="Something went wrong."
/>

Pass either a formId issued by Nua Site, or a custom action URL. You can override the default success, error, submitting, and retry copy via props.

Responsive image (Cloudflare)

---
import { Image } from '@nuasite/components'
---

<Image
  src="https://cdn.nuasite.com/assets/www-mangoweb-cz/vakovako-3.webp"
  alt="Abstract architectural pattern with curved windows."
  widths={[480, 768, 1024, 1400, 1920]}
  sizes="(min-width: 1024px) 60vw, 100vw"
  transformOptions={{ fit: 'cover', dpr: 1.5 }}
/>

Key props:

  • widths: Breakpoints used to build srcset (defaults provided).
  • sizes: sizes attribute string; controls browser selection.
  • transformOptions: Cloudflare transform params (quality, fit, dpr, format, etc.).
  • deliveryBase: Override /cdn-cgi/image if you proxy through another path or domain.
  • allowedDomains: Whitelist of hostnames that should be transformed. Leave empty to allow all; when set, non-matching hosts fall back to the original src with no transform.

Absolute src values keep their origin and prepend the transform path, e.g. https://cdn.nuasite.com/cdn-cgi/image/.../assets/file.webp.

Types

TypeScript projects can import the component props to help with strongly typed helper utilities:

import type { FormProps } from '@nuasite/components'

const defaults: FormProps = {
	formId: 'contact',
	successMessage: 'Success!',
}

FormProps ensures at least one of formId or action is provided at compile time, catching configuration mistakes early.

Local development

If you need to work on the components themselves:

cd packages/components
bun install
bunx tsx src/index.ts

During local testing you can import components directly via workspace links in your Astro project to iterate quickly.