1.0.9 • Published 10 months ago

@precooked/react-button v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

@precooked/react-button

Precooked Logo

@precooked/react-button is a versatile button component for React projects. It supports customizable colors, icons, shadows, and various size options.

Installation

npm install @precooked/react-button

Props

PropTypeDefaultDescription
titlestringrequiredThe text to display inside the button.
onClick() => voidrequiredFunction to handle the button click.
colorkeyof colors \| string'primary'The background color of the button (or the text color if type is not solid).
borderRadiusnumber4The border-radius of the button.
type"clear" | "outline" | "solid"'solid'The button style type.
disabledbooleanfalseDisable the button when true.
startIconstringundefinedIcon to display at the start of the button.
startIconPathsstring[]undefinedCustom SVG paths for the start icon.
startIconSizenumberundefinedCustom size for the start icon.
endIconstringundefinedIcon to display at the end of the button.
endIconPathsstring[]undefinedCustom SVG paths for the end icon.
endIconSizenumberundefinedCustom size for the end icon.
hasShadowbooleantrueWhether the button has a shadow or not.
stylesReact.CSSPropertiesundefinedCustom styles for the button container.
titleStylesReact.CSSPropertiesundefinedCustom styles for the title text.
size"xs" \| "sm" \| "md" \| "lg" \| "xl"'md'The size of the button, affecting padding and font-size.

Example Usage

import React from 'react';
import Button from '@precooked/react-button';

const MyComponent = () => (
  <Button 
    title="Click Me" 
    onClick={() => alert('Button clicked!')} 
    color="primary"
    type="solid"
    startIcon="home"
    endIcon="arrow-right"
    size="lg"
  />
);

export default MyComponent;

License

MIT


For more information, visit Precooked.

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 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

12 months ago

1.0.0

12 months ago