Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ba-js-icon

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 2.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

ba-js-icon

ba-js-icon is a set of common React icon components. SVG icons provide the raw material. SVGR is leveraged to create component equivalents.

Installation

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.

├── assets
│   └── icons
├── lib
│   └── icons
│       └── index.js
├── scripts
│   └── generate-icons.js # SVGR custom template
└── src
    └── icons

Build

yarn build

Usage

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/

FAQs

Package last updated on 09 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc