0.21.3 • Published 2 months ago

@ausbom/icon v0.21.3

Weekly downloads
126
License
MIT
Repository
github
Last release
2 months ago

@ausbom/icon

SystemIcon

import { SystemIcon } from '@ausbom/icon';
import ArrowLeft16 from '@ausbom/icon/lib/icons/system/ArrowLeft16';

<SystemIcon
  icon={ArrowLeft16}
  size={16}
  primaryColor="#1E1E1E"
  secondaryColor="#707070"
/>

Available system icons

There are a number of system icons available as React components. You'll find them in @ausbom/icon/lib/icons/system.

Each of these icon components can take a primaryColor and secondaryColor. While it's recommended to use them with the SystemIcon component, it is possible to render them by themselves.

Example:

import { SystemIcon } from '@ausbom/icon';
import ArrowLeft16 from '@ausbom/icon/lib/icons/system/ArrowLeft16'

// Used as standalone
<ArrowLeft16 primaryColor="#1E1E1E" secondaryColor="#707070" />

// Used with SystemIcon
<SystemIcon
  icon={ArrowLeft16}
  size={16}
  primaryColor="#1E1E1E"
  secondaryColor="#707070"
/>

Each icon provided by the design system is intended to be used at a certain size. Make sure you're using an icon that is designed to be displayed at the size you need.

Bring your own icons

If your project needs an icon that isn't provided in the design system, you can still use SystemIcon. The icon property can take any React component that renders SVG.

Example:

import { SystemIcon } from '@ausbom/icon';

const MyCustomIcon = props => {
  return (
    <svg>
      <path fill={props.primaryColor} class="__primary" ... />
      <path fill={props.secondaryColor} class="__secondary" ... />
    </svg>
  )
}

// Used with SystemIcon
<SystemIcon
  icon={MyCustomIcon}
  size={16}
  primaryColor="#1E1E1E"
  secondaryColor="#707070"
/>

Colourising system icons

Elements inside system icon SVG's use the classes .__primary and .__secondary. This allows dual-coloured icons to be colourised by CSS if needed. This can be useful for things like hover states.

Add these classes to the correct elements for any dual-coloured icon components that you provide.

.my-component .icon {
  .__primary {
    fill: red;
  }

  .__secondary {
    fill: blue;
  }
}
0.21.3

2 months ago

0.21.2

4 months ago

0.21.1

4 months ago

0.20.1

8 months ago

0.21.0

8 months ago

0.20.0

11 months ago

0.19.1

1 year ago

0.19.0

2 years ago

0.18.0

2 years ago

0.16.3

2 years ago

0.17.0

2 years ago

0.16.0

2 years ago

0.16.1

2 years ago

0.16.2

2 years ago

0.15.0

3 years ago

0.14.0

3 years ago

0.13.0

3 years ago

0.12.1

3 years ago

0.13.1

3 years ago

0.12.0

3 years ago

0.11.3

3 years ago

0.11.2

3 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.7.2

4 years ago

0.8.0

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.0

4 years ago

0.5.3

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.6

4 years ago

0.3.5

5 years ago

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago