1.0.9 • Published 9 months ago

@precooked/react-button v1.0.9

Weekly downloads
-
License
ISC
Repository
-
Last release
9 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

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

11 months ago

1.0.0

11 months ago