# ba-js-icon

> ba-js-icon is a set of common React icon components. SVG icons provide the raw material. [SVGR](https://react-svgr.com/) is leveraged to create component equivalents.

Latest version **2.0.2** (published 2022-05-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install ba-js-icon
pnpm add ba-js-icon
yarn add ba-js-icon
bun add ba-js-icon
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2022-05-09 |
| First published | 2021-11-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 92.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | npm |
| Maintainers | bookassist |

## Links

- npm: https://www.npmjs.com/package/ba-js-icon
- npm.io page: https://npm.io/package/ba-js-icon

## Dependencies (1)

- [node-dir](https://npm.io/package/node-dir.md) ^0.1.17

## Recent versions

- 2.0.2 (latest) — 2022-05-09
- 2.2.0-vite.0 (vite) — 2022-06-22
- 2.2.0 (next) — 2022-06-22
- 2.1.0 — 2022-06-01
- 2.0.1 — 2022-01-27
- 2.0.0 — 2022-01-27
- 1.2.1 — 2022-01-25
- 1.2.0 — 2022-01-25
- 1.1.1 — 2021-11-10
- 1.1.0 — 2021-11-09
- 1.0.2 — 2021-11-01
- 1.0.1 — 2021-11-01
- 1.0.0 — 2021-11-01

## README

# ba-js-icon

ba-js-icon is a set of common React icon components.  SVG icons provide the raw material.
[SVGR](https://react-svgr.com/) is leveraged to create component equivalents.

## Installation

```bash
yarn add ba-js-icon
```
    
## Documentation

SVG source files are stored in `assets/icons` (new icons are added here).  The build process converts these to React components (`src/icons`)
and transpiles them to ES5 (`lib/icons`). An auto-generated icon index `(lib/icons/index.js)` serves as the project entry point. 

```bash
├── assets
│   └── icons
├── lib
│   └── icons
│       └── index.js
├── scripts
│   └── generate-icons.js # SVGR custom template
└── src
    └── icons
``` 
## Build
```bash
yarn build
```
## Usage

```javascript
import { Arrow } from 'ba-js-icon'

export function StandardArrow() {
  return (
    <div>
      <Arrow /> // arrow will be colour and size of surrounding context
    </div>
  )
}

export function LargeGreenArrow() {
  return (
    <div style={{ fontSize: '54px', color: 'green' }}>
      <Arrow /> // arrow will be green and 54px
    </div>
  )
}

// .foo {
//   color: red;
//   font-size: 5em;
// }

export function LargeRedArrow() {
  return (
    <div>
      <Arrow className="foo" /> // arrow will be red and 5em
    </div>
  )
}
```

  
## FAQ

#### Why SVG?
https://www.irigoyen.dev/blog/2021/02/17/stop-using-icon-fonts/

https://css-tricks.com/icon-fonts-vs-svg/

---
_Source: https://npm.io/package/ba-js-icon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
