A customizable React button component.
npm install @bolttech/atoms-buttonA customizable React button component.
Use the package manager npm or yarn to install the component.
``bash`
npm install @bolttech/frontend-foundations @bolttech/atoms-button
or
`bash`
yarn add @bolttech/frontend-foundations @bolttech/atoms-button
The Button component accepts the following properties:
| Prop | Type | Description |
|---------------|--------------|-----------------------------------------------------------------------------------------------------------------|
| dataTestId | string | The data-testid attribute for testing. |boolean
| disabled | | Disables the button when set to true. |string
| title | | The text content of the button. |string
| variant | | The variant style of the button (e.g., 'primary', 'secondary', 'alternative'). |string
| size | | The size of the button (e.g., 'sm', 'md', 'lg'). |string
| iconRight | | The name of the icon to be displayed on the right side of the button. |string
| iconLeft | | The name of the icon to be displayed on the left side of the button. |boolean
| fullWidth | | Sets the button width to 100% if true. |string
| type | | The type of the button (e.g., 'button', 'submit', 'reset'). |function
| onClick | | Callback function to handle the button click event. |
`jsx
import React from 'react';
import {Button} from '@bolttech/atoms-button';
import {bolttechTheme, BolttechThemeProvider} from "@bolttech/frontend-foundations";
const ExampleComponent = () => {
const handleButtonClick = () => {
// Logic to handle the button click event
};
return (
dataTestId="custom-button"
disabled={false}
title="Click Me"
variant="primary"
size="md"
iconRight="arrow_forward"
fullWidth={false}
type="button"
onClick={handleButtonClick}
/>
);
};
export default ExampleComponent;
``
Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.
Please make sure to follow the code standards and test your changes before submitting.