0.1.58 • Published 3 months ago

abaabil v0.1.58

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

abaabil.icon

A lightweight SVG icon component for React.

Installation

npm install abaabil.icon

Usage

import React from 'react';
import Icon from 'abaabil.icon';

function MyApp() {
    return (
        <Icon
          size={32}
          iconName="myIcon"
        />
    );
}

Props

  • size (number, default: 32): Size of the icon.
  • iconName (string): ID of the icon in the SVG sprite.
  • style (object): Inline styles for the icon SVG element.

Icon Sprite

Important: This component expects an SVG sprite to be available at the root of your public directory.

Ensure that an SVG sprite is available at [your-domain]/sprite.svg. Each icon in the sprite should be given an ID, which will be referenced by the iconName prop.

Example SVG sprite structure:

<svg xmlns="http://www.w3.org/2000/svg">
  <symbol id="exampleIcon" viewBox="0 0 24 24">
    <!-- SVG path/data for the icon -->
  </symbol>
  <!-- More icons... -->
</svg>

Usage Example

To use an icon named exampleIcon from your sprite, utilize the iconName prop:

<Icon
  size={32}
  iconName="exampleIcon"
/>

The component will then render the icon using:

<use xlinkHref="/sprite.svg#exampleIcon" />

License

MIT

0.1.58

3 months ago

0.1.52

4 months ago

0.1.53

4 months ago

0.1.54

4 months ago

0.1.50

4 months ago

0.1.51

4 months ago

0.1.49

10 months ago

0.1.41

10 months ago

0.1.42

10 months ago

0.1.43

10 months ago

0.1.44

10 months ago

0.1.45

10 months ago

0.1.46

10 months ago

0.1.47

10 months ago

0.1.48

10 months ago

0.1.40

10 months ago

0.1.38

10 months ago

0.1.39

10 months ago

0.1.31

10 months ago

0.1.32

10 months ago

0.1.33

10 months ago

0.1.34

10 months ago

0.1.35

10 months ago

0.1.36

10 months ago

0.1.37

10 months ago

0.1.13

10 months ago

0.1.14

10 months ago

0.1.15

10 months ago

0.1.30

10 months ago

0.1.27

10 months ago

0.1.28

10 months ago

0.1.29

10 months ago

0.1.20

10 months ago

0.1.21

10 months ago

0.1.22

10 months ago

0.1.23

10 months ago

0.1.24

10 months ago

0.1.25

10 months ago

0.1.26

10 months ago

0.1.16

10 months ago

0.1.17

10 months ago

0.1.18

10 months ago

0.1.19

10 months ago

0.1.10

10 months ago

0.1.11

10 months ago

0.1.12

10 months ago

0.1.8

10 months ago

0.1.7

10 months ago

0.1.9

10 months ago

0.0.24

10 months ago

0.0.25

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.0.26

10 months ago

0.0.27

10 months ago

0.0.28

10 months ago

0.0.29

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.6

10 months ago

0.1.5

10 months ago

0.0.22

10 months ago

0.0.23

10 months ago

0.0.20

11 months ago

0.0.21

11 months ago

0.0.18

11 months ago

0.0.19

11 months ago

0.0.10

11 months ago

0.0.11

11 months ago

0.0.14

11 months ago

0.0.9

11 months ago

0.0.16

11 months ago

0.0.8

11 months ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago