3.7.0 • Published 3 days ago

@sumup/icons v3.7.0

Weekly downloads
583
License
Apache-2.0
Repository
github
Last release
3 days ago

@sumup/icons

A collection of icons for the web, part of the SumUp Circuit Design System.

Stars Version Coverage License Contributor Covenant

Installation

Depending on your preference, run one of the following in your terminal:

# With npm
npm install @sumup/icons

# With yarn v1
yarn add @sumup/icons

Usage

Import as React component

The easiest way to use an icon in React is to import it as a component. This approach works out of the box (no special loaders needed), is tree-shaking enabled, and comes with TypeScript typings included.

import { Check } from '@sumup/icons';

const SuccessMessage = ({ description }) => (
  <div>
    <Check />
    <span>{description}</span>
  </div>
);

Some icons have multiple sizes. They default to size '24', if supported, or to the smallest available size. Use the size prop to show one of the other sizes ('16' or '32') instead:

import { CircleCheckmark } from '@sumup/icons';

const SuccessMessage = ({ description }) => (
  <div>
    <CircleCheckmark size="24" />
    <span>{description}</span>
  </div>
);

To change the color of an icon, set the color property in CSS. The color will cascade down since the fill and stroke attributes of all monochrome icons are set to currentColor. Here's an example with a CSS-in-JS library:

import styled from '@emotion/styled';
import { Check } from '@sumup/icons';

const GreenCheck = styled(Check)`
  color: green;
`;

const SuccessMessage = ({ description }) => (
  <div>
    <GreenCheck />
    <span>{description}</span>
  </div>
);

Import as SVG file

Alternatively, it's possible to import the raw SVG files. Most bundlers require a special loader to make this work. For Webpack, we recommend the file-loader which turns the import into a URL to the SVG.

import checkIcon from '@sumup/icons/check_small.svg';

const SuccessMessage = ({ description }) => (
  <div>
    <img src={checkIcon} alt="" aria-hidden="true" />
    <span>{description}</span>
  </div>
);

It is not possible to change the color of an external SVG using the css color property. Instead, you can use the CSS filter hack to colorize the icon.

Load from a URL

The latest version of the icon library is automatically deployed to Vercel. The files are hosted behind a global CDN, so they load quickly for all users. You can load the icons from https://circuit.sumup.com/icons/v2/<name>_<size>.svg. Below are some examples:

<img
  src="https://circuit.sumup.com/icons/v2/checkmark_16.svg"
  alt="checkmark"
/>
.icon {
  background-image: url('https://circuit.sumup.com/icons/v2/checkmark_16.svg');
}

It is not possible to change the color of an external SVG using the CSS color property. Instead, you can use the CSS filter hack to colorize the icon.

3.7.0

3 days ago

3.6.1

2 months ago

3.6.0

3 months ago

3.5.0

3 months ago

3.4.0

4 months ago

3.0.0-next.2

10 months ago

2.29.0

10 months ago

2.30.1

10 months ago

2.30.0

10 months ago

3.2.0

7 months ago

3.0.0

9 months ago

3.3.0

6 months ago

3.1.0

8 months ago

2.28.1

11 months ago

2.28.0

11 months ago

3.0.0-next.1

12 months ago

2.25.0

12 months ago

2.27.0

11 months ago

2.24.0

1 year ago

2.26.0

12 months ago

3.0.0-next.0

1 year ago

2.22.0

1 year ago

2.21.0

1 year ago

2.23.0

1 year ago

2.20.0

1 year ago

2.19.0

1 year ago

2.18.0

1 year ago

2.17.0

1 year ago

2.15.0

2 years ago

2.16.0

1 year ago

2.14.0

2 years ago

2.11.0

2 years ago

2.13.0

2 years ago

2.12.0

2 years ago

2.10.0

2 years ago

2.8.0

2 years ago

2.9.1

2 years ago

2.7.0

2 years ago

2.9.0

2 years ago

2.6.0

2 years ago

2.7.0-canary.0

2 years ago

2.5.0

2 years ago

2.4.0

2 years ago

2.3.0

2 years ago

2.2.0

2 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0-next.1

3 years ago

2.0.0

3 years ago

2.0.0-next.0

3 years ago

1.9.0

3 years ago

1.9.0-canary.1

3 years ago

1.9.0-canary.0

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.1-next.0

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

3 years ago

1.5.2

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.2

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

1.0.0-canary.16

4 years ago

1.0.0-canary.15

4 years ago

1.0.0-canary.14

4 years ago

1.0.0-canary.13

4 years ago

1.0.0-canary.12

4 years ago

1.0.0-canary.8

4 years ago

1.0.0-canary.9

4 years ago

1.0.0-canary.10

4 years ago

1.0.0-canary.11

4 years ago

1.0.0-canary.7

4 years ago

1.0.0-canary.6

4 years ago

1.0.0-canary.5

4 years ago

1.0.0-canary.4

4 years ago

1.0.0-canary.3

4 years ago

1.0.0-canary.2

4 years ago

1.0.0-canary.1

4 years ago