1.0.7 • Published 11 months ago

@athosws/react-components v1.0.7

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

How to publish the package to npm

yarn rollup
yarn publish

ATHOS React Components

First install:

npm install @athosws/react-components
yarn add @athosws/react-components

ATHOSButton Component

The ATHOSButton component is a versatile button component that supports multiple styles and states, such as default, alt, action, and disabled. It allows for customization of colors, text, and additional styling. It also supports an optional tooltip that provides extra information when hovering over the button.

Animation

Import

To import the ATHOSButton component into your project, use the following import statement:

import { ATHOSButton } from "@athosws/react-components";

Usage

Basic Usage

import React from "react";
import { ATHOSButton } from "@athosws/react-components";

const App = () => {
  return (
    <ATHOSButton type="default" onClick={() => console.log("Button clicked!")}>
      Click Me
    </ATHOSButton>
  );
};

export default App;

With Tooltip

To use a tooltip, pass the tooltip prop with the desired content:

<ATHOSButton
  type="action"
  tooltip="This is an action button"
  onClick={() => console.log("Action button clicked!")}
>
  Action
</ATHOSButton>

Disabled State

To disable the button, set the disabled prop to true:

<ATHOSButton disabled={true}>Disabled Button</ATHOSButton>

Props

The ATHOSButton component accepts the following props:

PropTypeDescriptionDefault
type"default","alt","action"Specifies the button style. Required if disabled is not set."default"
onClick() => voidFunction to call when the button is clicked. Optional for disabled buttons.undefined
childrenReact.ReactNodeThe content to be displayed inside the button.undefined
tooltipReact.ReactNodeContent to be shown as a tooltip when hovering over the button. Optional.undefined
disabledbooleanIf set to true, the button is rendered in a disabled state and does not respond to click events.false
styleReact.CSSPropertiesCustom styles to apply to the button.undefined
colorstringBackground color of the button.Depends on type
textColorstringText color of the button.Depends on type
1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago