@monime/my-button
v1.0.2
Published
A simple, reusable React button component with TypeScript support.
Readme
@monime/my-button
A simple, reusable React button component with TypeScript support.
Installation
npm install @monime/my-buttonUsage
import { Button, ButtonProps } from "@monime/my-button";
function App() {
const handleClick = () => {
console.log("Button clicked!");
};
return (
<div>
<Button onClick={handleClick}>Click me!</Button>
<Button type="submit">Submit Form</Button>
<Button type="reset">Reset Form</Button>
</div>
);
}Props
| Prop | Type | Default | Description |
| ---------- | --------------------------------- | ----------- | --------------------------------------- |
| children | ReactNode | - | Content to display inside the button |
| onClick | () => void | undefined | Function to call when button is clicked |
| type | "button" \| "submit" \| "reset" | "button" | HTML button type attribute |
Features
- 🎨 Pre-styled with a modern blue theme
- 🔧 Fully typed with TypeScript
- ♿ Accessible by default
- 🧪 Thoroughly tested (100% coverage)
- 📦 Supports both ESM and CommonJS
- ⚡ Lightweight with no external dependencies
Development
# Install dependencies
npm install
# Run tests
npm test
# Run tests with coverage
npm run test:coverage
# Build the package
npm run buildLicense
ISC
