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

afro-npm-nextjs

v1.1.3

Published

Un paquete de componentes React optimizado para Next.js 15 con App Router

Readme

afro-npm-nextjs

Un paquete de componentes React optimizado para Next.js 15 con App Router. Incluye componentes modernos y reutilizables con soporte completo para TypeScript.

🚀 Características

  • Next.js 15 con App Router
  • TypeScript completo
  • CSS Modules para estilos aislados
  • Dark mode automático
  • Responsive design
  • Accesibilidad (a11y)
  • Tree shaking optimizado

📦 Instalación

npm install afro-npm-nextjs
# o
yarn add afro-npm-nextjs
# o
pnpm add afro-npm-nextjs

🔧 Uso

NextCard

Un componente de tarjeta versátil y moderno:

import { NextCard } from "afro-npm-nextjs";

export default function Page() {
  return (
    <NextCard
      title="Mi Tarjeta"
      description="Una descripción opcional"
      variant="primary"
      onClick={() => console.log("Tarjeta clickeada!")}
    >
      <p>Contenido personalizado aquí</p>
    </NextCard>
  );
}

Props de NextCard

| Prop | Tipo | Default | Descripción | | ------------- | ----------------------------------------------------- | ----------- | ------------------------------ | | title | string | - | Título principal de la tarjeta | | description | string | - | Descripción opcional | | children | ReactNode | - | Contenido hijo | | variant | 'default' \| 'primary' \| 'secondary' \| 'outlined' | 'default' | Variante visual | | onClick | function | - | Callback para clicks |

NextButton

Un botón moderno con múltiples variantes y estados:

import { NextButton } from "afro-npm-nextjs";

export default function Page() {
  return (
    <div>
      <NextButton variant="primary" size="lg">
        Botón Principal
      </NextButton>

      <NextButton variant="outline" loading={true} icon={<span>🚀</span>}>
        Cargando...
      </NextButton>
    </div>
  );
}

Props de NextButton

| Prop | Tipo | Default | Descripción | | ---------- | --------------------------------------------------------------- | ----------- | ------------------- | | children | ReactNode | - | Contenido del botón | | variant | 'default' \| 'primary' \| 'secondary' \| 'outline' \| 'ghost' | 'default' | Variante visual | | size | 'sm' \| 'md' \| 'lg' | 'md' | Tamaño del botón | | loading | boolean | false | Estado de carga | | icon | ReactNode | - | Icono opcional |

🎨 Variantes y Estilos

Variantes de NextCard

  • default: Tarjeta blanca con borde sutil
  • primary: Gradiente azul-púrpura
  • secondary: Fondo gris claro
  • outlined: Transparente con borde azul

Variantes de NextButton

  • default: Gris claro
  • primary: Azul
  • secondary: Gris oscuro
  • outline: Transparente con borde
  • ghost: Sin fondo, solo texto

🌙 Dark Mode

Los componentes soportan automáticamente el modo oscuro usando prefers-color-scheme.

🔧 Requisitos

  • React ≥18
  • Next.js ≥14 (optimizado para Next.js 15)
  • TypeScript (recomendado)

📱 Ejemplo Completo

"use client";

import { NextCard, NextButton } from "afro-npm-nextjs";
import { useState } from "react";

export default function Example() {
  const [loading, setLoading] = useState(false);

  const handleAction = async () => {
    setLoading(true);
    // Simular API call
    await new Promise((resolve) => setTimeout(resolve, 2000));
    setLoading(false);
  };

  return (
    <div
      style={{
        padding: "20px",
        display: "flex",
        gap: "20px",
        flexWrap: "wrap",
      }}
    >
      <NextCard
        title="Tarjeta Interactiva"
        description="Click para ver la acción"
        variant="primary"
        onClick={() => alert("¡Tarjeta clickeada!")}
      >
        <NextButton
          variant="outline"
          size="sm"
          onClick={(e) => {
            e.stopPropagation();
            handleAction();
          }}
          loading={loading}
        >
          {loading ? "Procesando..." : "Ejecutar Acción"}
        </NextButton>
      </NextCard>

      <NextCard
        title="Tarjeta Simple"
        description="Sin interactividad"
        variant="outlined"
      >
        <p>Contenido estático aquí</p>
      </NextCard>
    </div>
  );
}

🚀 Desarrollo

# Instalar dependencias
npm install

# Construir el paquete
npm run build

# Verificar tipos
npm run type-check

# Modo desarrollo con watch
npm run dev
npm install

Puedes probarlo en otra app local usando:


## 📄 Licencia

MIT

## 🤝 Contribuir

Las contribuciones son bienvenidas. Por favor abre un issue o pull request.

---

**Optimizado para Next.js 15 con App Router** 🚀