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

bpk-component-icon

Package Overview
Dependencies
Maintainers
1
Versions
530
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpk-component-icon

Backpack icon components.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.4K
decreased by-6.76%
Maintainers
1
Weekly downloads
 
Created
Source

bpk-component-icon

Backpack icon components.

Note: All icon components are generated using the react-svg-loader cli tool. Whilst this alleviates the need to hand crank every component, it limits the ability to encapsulate styling options and default fill color. See the examples below on how to overcome these limitations.

Installation

npm install bpk-component-icon --save

Basic usage

import React from 'react'
import TOKENS from 'bpk-tokens/tokens/base.common'
import BpkSmallFlightIcon from 'bpk-component-icon/sm/flight'
import BpkLargeAccessibilityIcon from 'bpk-component-icon/lg/accessibility'

export default MyComponent = () => (
  <div>
    <BpkSmallFlightIcon fill={TOKENS.colorBlue500} />
    <BpkLargeAccessibilityIcon fill={TOKENS.colorGray700} />
  </div>
)

Note: Due to the way that they are generated, there are no prop types defined on any of the icon components. Any props that you pass through will be rendered directly to the DOM.

Aligning to BpkButton components

import React from 'react'
import BpkButton from 'bpk-component-button'
import TOKENS from 'bpk-tokens/tokens/base.common'
import { alignToButton } from 'bpk-component-icon'
import BpkSmallFlightIcon from 'bpk-component-icon/sm/flight'

const AlignedBpkSmallFlightIcon = alignToButton(BpkSmallFlightIcon)

export default MyComponent = () => (
  <BpkButton>
    <AlignedBpkSmallFlightIcon fill={TOKENS.colorWhite} />
  </BpkButton>
)

FAQs

Package last updated on 20 Sep 2016

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