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.