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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-button-maker

v1.0.3

Published

A flexible React component for building fully customizable buttons with user-defined text and styling.

Readme

📦 react-button-maker

A simple and flexible React component for creating fully customizable buttons with optional text overlays. Build buttons your way with complete styling control.


✨ Features

  • 🎨 Full Customization — Style buttons and text exactly as you need them
  • 🧩 Framework Agnostic — Works seamlessly with Tailwind CSS, styled-components, or plain CSS
  • ⚡ Lightweight — Minimal dependencies, maximum performance
  • 📝 Flexible Text — Add primary and secondary text labels
  • ♻️ Modern React — Built for React 19
  • 🎯 Zero Default Styles — You have complete control over appearance
  • 📘 TypeScript Support — Full type safety with React.ButtonHTMLAttributes

📦 Installation

Install the package using your preferred package manager:

npm install react-button-maker
yarn add react-button-maker

🚀 Quick Start

Step 1: Import the component

import ButtonMaker from "react-button-maker";

Step 2: Add to your component

<ButtonMaker
  label="Click Me"
  text="Secondary"
  buttonStyle="bg-blue-600 text-white px-4 py-2 rounded"
  textStyle="text-gray-200 text-sm"
  onClick={() => console.log("Clicked")}
/>

📋 Props Reference

| Prop | Type | Required | Description | |------|------|----------|-------------| | label | string | ✓ | Main button text displayed inside the button | | text | string | — | Optional secondary text rendered inline with the button | | buttonStyle | string | — | CSS classes or inline styles for the button element | | textStyle | string | — | CSS classes or inline styles for the optional text element | | onClick | () => void | — | Callback function triggered on button click | | disabled | boolean | — | Disable the button (standard HTML attribute) | | type | "button" \| "submit" \| "reset" | — | Button type (standard HTML attribute) | | ...rest | React.ButtonHTMLAttributes | — | All standard HTML button attributes supported |


💡 Examples

Using Tailwind CSS

Create a polished button with Tailwind utilities:

<ButtonMaker 
  label="Submit"
  text="Now"
  buttonStyle="bg-green-600 text-white px-6 py-3 rounded-lg hover:bg-green-700 transition-colors"
  textStyle="text-yellow-200 ml-2 text-sm"
  onClick={() => alert("Form submitted!")}
/>

Using Plain CSS

Define custom styles in your stylesheet:

<ButtonMaker 
  label="Save"
  text="Changes"
  buttonStyle="custom-btn"
  textStyle="secondary-label"
  onClick={handleSave}
/>

styles.css:

.custom-btn {
  background-color: #333;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.custom-btn:hover {
  background-color: #555;
}

.secondary-label {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
  opacity: 0.9;
}

TypeScript Usage

Full type safety in your React/TypeScript project:

import ButtonMaker from "react-button-maker";

function App() {
  const handleClick = () => {
    console.log("Button clicked!");
  };

  return (
    <ButtonMaker
      label="Click Me"
      buttonStyle="bg-blue-600 text-white px-4 py-2 rounded hover:bg-blue-700"
      onClick={handleClick}
      disabled={false}
      type="button"
      aria-label="Submit button"
    />
  );
}

export default App;

Advanced: Standard HTML Attributes

Use any standard button HTML attributes:

<ButtonMaker
  label="Delete"
  text="Permanent"
  buttonStyle="bg-red-600 text-white px-6 py-3 rounded"
  onClick={handleDelete}
  disabled={isLoading}
  type="button"
  aria-label="Delete item permanently"
  data-testid="delete-button"
  title="This action cannot be undone"
/>

🛠️ Development

Setup

Clone and install the repository:

git clone https://github.com/Q-Niranjan/react-button-maker
cd react-button-maker
npm install

Build

Build the package for distribution:

npm run build

📄 License

MIT License © 2025

You're free to use this package in personal and commercial projects. See the LICENSE file for details.


🤝 Contributing

We welcome contributions! Feel free to submit issues or pull requests to help improve react-button-maker.