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

react-button-catalog

v1.0.0

Published

Librería de botones React + TailwindCSS con 18 estilos, totalmente customizable e iconos de cualquier librería.

Readme

react-button-catalog

Librería de botones React + Tailwind CSS v4 con 18 estilos, 4 tamaños, totalmente customizable y con soporte de íconos de cualquier librería.

Creada a partir del catálogo de botones “Lumina Interface” (estilos Material 3, Glassmorphism, Neumorphic, Brutalista, Gótico, Futurista, Neón, Cartoon, Material/Google, Fluent/Microsoft, Pixel Art, Minecraft, Anime y Cyberpunk).

React Tailwind TypeScript MIT


✨ Características

  • 🎨 18 variantes × múltiples paletas de color por variante (25+ looks).
  • 🔤 4 tamaños (sm, md, lg, xl) con tokens de tipografía propios.
  • 🧩 Íconos de cualquier librería: lucide-react, react-icons, Material Symbols, emojis, SVGs… cualquier ReactNode funciona (icon, trailingIcon, iconOnly).
  • 🌙 Dark mode por clase (dark en <html>), incluido en los estilos.
  • Estado de carga con spinner (customizable).
  • 🔗 Polimórfico: renderiza <button>, <a>, <Link> de Next.js, etc. (as).
  • 📐 fullWidth, redondeo configurable (rounded), className y style para overrides totales.
  • Accesible: focus rings visibles, aria-disabled, estados disabled correctos.
  • 📦 Cero configuración: importa un CSS compilado o usa el theme como preset de Tailwind v4.

📦 Instalación

npm install react-button-catalog
# o
pnpm add react-button-catalog
# o
yarn add react-button-catalog

Requiere react >= 18 y tailwindcss solo si quieres la integración con tu propio build de Tailwind (opción B). La opción A no requiere Tailwind.


🚀 Quickstart

Opción A — Sin configuración (importa el CSS compilado)

Importa el CSS de la librería una sola vez (en tu entry point) y listo:

import { Button } from "react-button-catalog";
import "react-button-catalog/styles.css"; // CSS compilado (incluye fuentes + tokens + dark mode)

export function App() {
  return (
    <div>
      <Button variant="primary" icon={<Rocket />}>Primary Action</Button>
      <Button variant="gradient" color="sunset">Sunset Glow</Button>
      <Button variant="neon" color="lime" rounded="md">LIME GLOW</Button>
    </div>
  );
}

Opción B — Con tu propio build de Tailwind v4 (recomendado para apps Tailwind)

En tu archivo CSS principal:

@import "tailwindcss";
@import "react-button-catalog/theme.css";   /* tokens de diseño */
@source "../node_modules/react-button-catalog/dist"; /* escanea las utilities del componente */

Así Tailwind genera solo las utilities que uses (tree-shaking real) y puedes sobrescribir los tokens desde tu propio @theme.

⚠️ Importa una sola de las dos opciones (A o B), nunca ambas.


🎨 Las 18 variantes

type ButtonVariant =
  | "primary" | "outline" | "ghost"        // Base (Material 3)
  | "glass"                                 // iOS / Glassmorphism
  | "gradient"                              // Degradados
  | "neumorphic"                            // Skeuomorphic
  | "brutalist"                             // Retro / Brutalista
  | "minimalist"                            // Minimalista
  | "gothic"                                // Gótico
  | "futuristic"                            // Futurista
  | "neon"                                  // Neón
  | "cartoon"                               // Cartoon
  | "material"                              // Google (Material 3)
  | "fluent"                                // Microsoft (Fluent)
  | "pixel"                                 // Pixel Art
  | "minecraft"                             // Minecraft
  | "anime"                                 // Anime
  | "cyberpunk";                            // Cyberpunk

Paletas por variante (prop color)

| Variante | Colores disponibles | | ------------- | ---------------------------------------------------- | | primary | default | | outline | default | | ghost | default | | glass | default, primary | | gradient | ocean, sunset, aurora | | neumorphic | soft, pill | | brutalist | yellow, orange, white | | minimalist | gray, border, soft | | gothic | crimson, veil, obsidian | | futuristic | system, link, cmd | | neon | lime, pink, cyan | | cartoon | pow, bam, zap | | material | google, tonal, outline | | fluent | primary, standard, subtle | | pixel | default | | minecraft | default | | anime | default | | cyberpunk | access, glitch |

<Button variant="gradient" color="aurora">Aurora</Button>
<Button variant="cartoon" color="bam">BAM</Button>
<Button variant="cyberpunk" color="access">Access</Button>

Cada variante tiene un redondeo por defecto; sobrescríbelo con rounded.


🧩 Íconos de cualquier librería

icon, trailingIcon e iconOnly aceptan cualquier ReactNode. Por eso puedes usar cualquier librería de íconos:

// lucide-react
import { Rocket, Heart, ArrowRight } from "lucide-react";
<Button icon={<Rocket />} trailingIcon={<ArrowRight />}>Go</Button>

// react-icons (Font Awesome / Material / etc.)
import { FaRocket } from "react-icons/fa";
<Button icon={<FaRocket />}>Launch</Button>

// Material Symbols (fuente)
<Button icon={<span className="material-symbols-outlined">rocket_launch</span>}>Launch</Button>

// Emojis
<Button icon="🚀">Launch</Button>

// SVG inline
<Button icon={<svg viewBox="0 0 24 24" fill="currentColor"><path d="..." /></svg>}>Launch</Button>

Los íconos se escalan automáticamente al tamaño del botón (SVGs con size-full).

<Button iconOnly icon={<Search />} aria-label="Buscar" />  // botón cuadrado solo ícono
<Button icon={<Heart />}>Leading</Button>                   // ícono inicial
<Button trailingIcon={<ArrowRight />}>Trailing</Button>     // ícono final

⚙️ API de props

| Prop | Tipo | Default | Descripción | | --------------- | --------------------------- | ------------- | ------------------------------------------------------------------ | | variant | ButtonVariant | "primary" | Familia de estilo (las 18). | | color | string | "default" | Paleta dentro de la variante. | | size | "sm" \| "md" \| "lg" \| "xl" | "md" | Tamaño del botón. | | rounded | "none" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl" \| "full" | según variante | Redondeo de esquinas. | | icon | ReactNode | — | Ícono inicial. | | trailingIcon | ReactNode | — | Ícono final. | | iconOnly | boolean | false | Botón cuadrado solo ícono. | | loading | boolean | false | Muestra spinner y desactiva. | | spinner | ReactNode | — | Spinner personalizado. | | fullWidth | boolean | false | width: 100%. | | as | ElementType | "button" | Renderiza como a, Link, etc. | | className | string | — | Clases extra (overrides). | | style | CSSProperties | — | Estilos inline. | | disabled, type, onClick, aria-*, data-*… | hereda de <button> | | |

<Button
  variant="outline"
  size="lg"
  rounded="full"
  icon={<Mail />}
  loading={sending}
  fullWidth
>
  Enviar mensaje
</Button>

🔧 Customización

1. className — anula cualquier clase

<Button className="!bg-emerald-500 hover:!bg-emerald-600 text-white shadow-lg">
  Verde personalizado
</Button>

2. style — estilos inline

<Button style={{ background: "linear-gradient(135deg, #f97316, #db2777)", color: "#fff" }}>
  Gradiente inline
</Button>

3. Tokens de tema — cambia toda la librería (Tailwind v4)

Con la Opción B, sobrescribe los tokens en tu @theme:

@import "tailwindcss";
@import "react-button-catalog/theme.css";

@theme {
  --color-primary: #7c3aed;      /* cambia el azul primario a violeta */
  --radius-btn-md: 0.75rem;      /* esquinas más redondeadas */
  --spacing-btn-px-md: 1.25rem;  /* más padding horizontal */
}

Tokens disponibles: --color-* (paleta Material 3 completa), --font-button-*, --text-button-*, --radius-btn-* y --spacing-btn-*.

4. Tema oscuro

Añade/remueve la clase dark en el elemento raíz:

document.documentElement.classList.toggle("dark", enabled);

Los estilos base (primary, outline, ghost, glass, minimalist, …) incluyen variantes dark: ya configuradas.


🔗 Renderizado polimórfico (as)

// Como <a>
<Button as="a" href="/docs" variant="gradient">Documentación</Button>

// Como Link de Next.js
import Link from "next/link";
<Button as={Link} href="/dashboard">Dashboard</Button>

// Como <button> nativo (por defecto)
<Button onClick={handleClick}>Guardar</Button>

Los props del elemento destino (href, target, etc.) se infieren en TypeScript.


⏳ Estados: loading y disabled

<Button loading>Enviando…</Button>            {/* spinner por defecto */}
<Button loading spinner={<CustomSpinner />}>Cargando</Button>
<Button disabled>No disponible</Button>

🚀 Next.js / SSR / Vite

  • Next.js (App Router): el componente es 100% cliente-compatible. Úsalo directamente en componentes clientes ("use client" si lo necesitas).
  • Vite / Remix / Astro: compatible sin configuración extra; importa el CSS en tu entry point.
  • El paquete publica ESM + CJS + .d.ts (tipos incluidos).

🧑‍💻 Desarrollo de la librería

npm install        # instala dependencias
npm run dev        # demo en vivo (localhost:5173)
npm run build      # compila la librería → dist/ (JS, CJS, CSS, d.ts)
npm run build:demo # compila el sitio demo estático → demo-dist/
npm run typecheck  # chequeo de tipos

Estructura

src/
├── index.ts          # entry point de la librería (exports públicos)
├── Button.tsx        # componente <Button>
├── buttonStyles.ts   # mapas de estilos: 18 variantes × colores, tamaños, radios
├── types.ts          # tipos públicos (ButtonProps, ButtonVariant, …)
├── theme.css         # tokens de diseño (shipped como react-button-catalog/theme.css)
├── index.css         # CSS de la librería (compilado a styles.css)
└── demo/             # página demo (Vite)

📄 Documentación adicional

📝 Licencia

MIT © react-button-catalog