1.1.1 • Published 12 months ago

abhi-react-lib v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

React Button Package

A customizable button component for React with support for variants, custom colors, and additional styles.

npm npm npm bundle size npm

Table of Contents

Installation

To install the package, you can use npm or yarn:

npm install npm i abhi-react-lib
# or
yarn add npm i abhi-react-lib

Usage

import React from "react";
import { Button } from "your-button-package";

const App = () => {
  return (
    <div>
      <Button onClick={() => alert("Default Button")}>Default Button</Button>
      <Button variant="success" onClick={() => alert("Success Button")}>
        Success Button
      </Button>
      <Button variant="danger" onClick={() => alert("Danger Button")}>
        Danger Button
      </Button>
      <Button color="#ff6600" onClick={() => alert("Custom Color Button")}>
        Custom Color Button
      </Button>
      <Button
        style={{ padding: "15px 30px", fontSize: "1.5em" }}
        onClick={() => alert("Styled Button")}
      >
        Styled Button
      </Button>
      <Button disabled onClick={() => alert("This should not alert!")}>
        Disabled Button
      </Button>
    </div>
  );
};

export default App;

API

Button

A customizable button component.

Props

  • children (ReactNode): The content to be displayed inside the button.
  • onClick (function): An optional click event handler.
  • color (string): An optional prop to set a custom background color.
  • variant ("default" | "success" | "danger"): An optional prop to set - predefined color variants. Defaults to "default".
  • style (React.CSSProperties): An optional prop to pass additional styles to the button.
  • disabled (boolean): An optional prop to disable the button.
1.1.1

12 months ago

1.0.9

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago

1.0.5

12 months ago

1.0.4

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago