1.0.14 • Published 9 months ago

@precooked/react-icon v1.0.14

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

@precooked/react-icon

Precooked Logo

@precooked/react-icon is a customizable icon component for React projects. It supports dynamic icon paths, sizes, and colors, allowing users to use predefined icons or custom SVG paths.

Installation

npm install @precooked/react-icon

Props

PropTypeDefaultDescription
namestringundefinedThe name of the icon to display, based on the icons data array. Optional if paths is provided.
pathsIconPath[]undefinedArray of custom SVG path objects to render instead of a predefined icon.
sizenumber24The size of the icon in pixels.
stylesReact.CSSProperties{}Custom styles for the icon container.
colorkeyof colors \| stringundefinedOverride color for the icon, using a color key from colors or a valid color string.

IconPath interface

interface IconPath {
    d: string;
    color?: keyof typeof colors \| string;
}

Example Usage

import React from 'react';
import Icon from '@precooked/react-icon';

const MyComponent = () => (
  <div>
    <Icon name="home" size={32} color="primary" />
    <Icon 
      paths={[
        { d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z", color: "secondary" },
      ]}
      size={40}
      styles={{ margin: '10px' }}
    />
  </div>
);

export default MyComponent;

License

MIT


For more information, visit Precooked.

1.0.14

9 months ago

1.0.13

9 months ago

1.0.12

9 months ago

1.0.8

9 months ago

1.0.11

9 months ago

1.0.10

9 months ago

1.0.7

10 months ago

1.0.6

10 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