0.3.2 • Published 6 months ago

react-ts-droid-button v0.3.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

DroidButton is a customizable React component for creating buttons with various styling options. It's written in TypeScript for better type safety and maintainability.

Features

  • Customizable appearance (background color, text color, dimensions)
  • Configurable margins
  • Optional icon support
  • Disabled state handling
  • TypeScript support for type safety

Installation

To use the Button component in your React application, install it via npm:

npm install react-ts-droid-button

Usage

To use the Button component, import it and provide the required props:

import { Button } from "react-ts-droid-button";

<DroidButton
  title="Click me"
  bgColor="#007bff"
  color="#ffffff"
  mTop={10}
  mBottom={10}
  mLeft={0}
  mRight={0}
  width={400}
  braduis={10}
  icon={<FaBookReader className="style-home-icon" />}
  onClickButton={() => console.log("Button clicked")}
/>;

Props

The Button component accepts the following props:

PropTypeRequiredDescription
titlestringYesThe text to display on the button
bgColorstringYesThe background color of the button
colorstringYesThe text color of the button
mTopnumberYesMargin top
mBottomnumberYesMargin bottom
mLeftnumberYesMargin left
mRightnumberYesMargin right
fWeightnumberNoFont weight of the button text
heightnumberNoHeight of the button
widthnumberNoWidth of the button
disabledbooleanNoWhether the button is disabled
disabledColorstringNoBackground color when the button is disabled
iconReact.ReactNodeNoIcon to display alongside the button text
onClickButton() => voidYesFunction to call when the button is clicked

The Button component provides a flexible and customizable way to create buttons in your React application. With its various styling options and TypeScript support, it can easily be integrated into your project and styled to match your design requirements.

0.3.2

6 months ago

0.3.1

6 months ago

0.3.0

6 months ago

0.2.0

6 months ago

0.1.0

6 months ago