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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sportstats-result-tables

v1.0.0-beta-5

Published

A customizable button component for React applications, available in both bundled and unbundled versions to suit various integration scenarios.

Downloads

46

Readme

Simple React Button

A customizable button component for React applications, available in both bundled and unbundled versions to suit various integration scenarios.

Installation

You can install simple-react-button using npm or yarn:

npm install simple-react-button

or

yarn add simple-react-button


Usage
Unbundled Version
The unbundled version is ideal for projects that already use React. This version does not include React and ReactDOM, so you must have them installed in your project.

To use the component in your React application:

import React from 'react';
import { SimpleButton } from 'simple-react-button';

function App() {
  return (
    <SimpleButton onClick={() => alert('Button clicked!')}>
      Click Me
    </SimpleButton>
  );
}

export default App;



Certainly! Below is a template for a README.md file that outlines how to use both the bundled and unbundled versions of your React component package, named simple-react-button. You should customize this template to fit the specifics of your component and package.

markdown
Copy code
# Simple React Button

A customizable button component for React applications, available in both bundled and unbundled versions to suit various integration scenarios.

## Installation

You can install `simple-react-button` using npm or yarn:

```bash
npm install simple-react-button
or

bash
Copy code
yarn add simple-react-button
Usage
Unbundled Version
The unbundled version is ideal for projects that already use React. This version does not include React and ReactDOM, so you must have them installed in your project.

To use the component in your React application:


import React from 'react';
import { SimpleButton } from 'simple-react-button';

function App() {
  return (
    <SimpleButton onClick={() => alert('Button clicked!')}>
      Click Me
    </SimpleButton>
  );
}

export default App;

Bundled Version
The bundled version includes React and ReactDOM, allowing you to use SimpleButton directly in HTML pages without any additional setup for React. This is perfect for projects that do not use React as their main framework or for adding React components to existing pages quickly.

To use the bundled version, include the script in your HTML and use the SimpleButton class to mark where you want the button to appear:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Simple Button Demo</title>
</head>
<body>
    <div class="SimpleButton" data-raceid="1234"></div>

    <script src="path/to/dist/simple-react-button.with-react.js"></script>
</body>
</html>


Props
List and explain the props your component accepts, for example:

onClick: Function to be called when the button is clicked.
data-raceid: An example data attribute that demonstrates how to pass custom data to the component in the bundled version.
Development
Explain how to set up the development environment for your package, if applicable.

Contributing
Instructions for how to contribute to the package, if you are accepting contributions.