1.0.15 • Published 9 months ago

@precooked/react-icon-button v1.0.15

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

@precooked/react-icon-button

Precooked Logo

@precooked/react-icon-button is a versatile icon button component for React projects. It supports different button sizes, colors, and types, with customizable icons and shadows.

Installation

npm install @precooked/react-icon-button

Props

PropTypeDefaultDescription
onClick() => voidrequiredFunction to handle the button click.
colorkeyof colors \| string'primary'Background color of the button when type is solid; or text color for other types.
borderRadiusnumber22Border radius of the button in pixels.
type"clear" \| "outline" \| "solid"'solid'Button style type.
disabledbooleanfalseDisables the button when true.
iconstringundefinedIcon name to display inside the button.
iconPathsany[]undefinedCustom SVG paths for the icon.
iconSizenumberundefinedSize of the icon in pixels, defaulting to the size based on size.
hasShadowbooleantrueWhether the button has a shadow.
stylesReact.CSSPropertiesundefinedCustom styles for the button.
size"xs" \| "sm" \| "md" \| "lg" \| "xl"'md'Size of the button, affecting its dimensions and icon size.

Example Usage

import React from 'react';
import IconButton from '@precooked/react-icon-button';

const MyComponent = () => (
    <div>
        <IconButton 
            onClick={() => alert('Button clicked!')} 
            color="primary" 
            icon="home" 
            size="lg" 
            type="solid" 
            hasShadow={true} 
        />
        <IconButton 
            onClick={() => alert('Another button clicked!')} 
            color="#ff5733" 
            icon="settings" 
            size="sm" 
            type="outline" 
            borderRadius={10} 
            hasShadow={false} 
        />
    </div>
);

export default MyComponent;

License

MIT


For more information, visit Precooked.

1.0.15

9 months ago

1.0.14

9 months ago

1.0.13

9 months ago

1.0.11

9 months ago

1.0.12

9 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.10

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago