11.61.0 • Published 12 days ago

@carbon/pictograms-react v11.61.0

Weekly downloads
6,928
License
Apache-2.0
Repository
github
Last release
12 days ago

@carbon/pictograms-react

React components for pictograms in digital and software products using the Carbon Design System

Getting started

To install @carbon/pictograms-react in your project, you will need to run the following command using npm:

npm install -S @carbon/pictograms-react

If you prefer Yarn, use the following command instead:

yarn add @carbon/pictograms-react

Usage

Icons in this package support the following sizes: 16, 20, 24, and 32 pixels. These sizes refer to the width and height of the icon. You can import an icon component into your project by referring to its name and size:

import { Add24 } from '@carbon/pictograms-react';

We also provide CommonJS and UMD files in the lib and umd directories, respectively.

To import using CommonJS, you can do the following:

const { Add24 } = require('@carbon/pictograms-react');

Note: if you would like to find the import path for an icon, you can reference our Icon Library

Icon fill

All icons from the library support being styled by the fill property. You can change the color of an icon by passing in a custom class name that sets this property (preferred), or by passing in an inline style. For example:

// CSS custom class name to set the fill of the icon to `rebeccapurple`
svg.my-custom-class {
  fill: rebeccapurple;
}
import { Airplane } from '@carbon/pictograms-react';

function MyComponent() {
  return (
    <button>
      <Airplane aria-label="Add" className="my-custom-class" />
    </button>
  );
}

Focus and aria-label

By default, the icon components from @carbon/pictograms-react are treated as decorative content. This means that we set aria-hidden="true" unless certain props are passed to the component.

If you would like the icon to be announced by a screen reader, you can supply an aria-label or aria-labelledby. For example:

import { Airplane } from '@carbon/pictograms-react';

function MyComponent() {
  return (
    <button>
      <Airplane aria-label="Add" />
    </button>
  );
}

Doing this will add the appropriate role to the <svg> node, as well.

If you would like the <svg> to receive focus, you will need to pass in a tabIndex value. For example:

import { Airplane } from '@carbon/pictograms-react';

function MyComponent() {
  return <Airplane aria-label="Add" tabIndex="0" />;
}

Including tabIndex and aria-label (or aria-labelledby) will set the corresponding tabindex on the underlying <svg> and verify support in older browsers like Internet Explorer 11 by setting focusable to true.

🙌 Contributing

We're always looking for contributors to help us fix bugs, build new features, or help us improve the project documentation. If you're interested, definitely check out our Contributing Guide! 👀

📝 License

Licensed under the Apache 2.0 License.

11.61.0

12 days ago

11.61.0-rc.1

14 days ago

11.61.0-rc.0

25 days ago

11.60.0

26 days ago

11.60.0-rc.0

28 days ago

11.59.0

1 month ago

11.59.0-rc.0

1 month ago

11.58.0-rc.0

2 months ago

11.58.0

2 months ago

11.25.4

2 months ago

11.57.0

3 months ago

11.57.0-rc.0

3 months ago

11.56.1

4 months ago

11.56.0

4 months ago

11.56.0-rc.0

4 months ago

11.25.3

4 months ago

11.55.0

5 months ago

11.55.0-rc.0

5 months ago

11.54.0

5 months ago

11.54.0-rc.0

5 months ago

11.50.0

7 months ago

11.47.0

9 months ago

11.53.0-rc.0

6 months ago

11.46.0

10 months ago

11.46.1

9 months ago

11.46.0-rc.0

10 months ago

11.45.0-rc.0

10 months ago

11.47.0-rc.0

9 months ago

11.48.0-rc.0

9 months ago

11.49.0-rc.0

8 months ago

11.52.0

6 months ago

11.52.1

6 months ago

11.45.0

10 months ago

11.45.1

10 months ago

11.45.2

10 months ago

11.49.0

8 months ago

11.52.0-rc.0

6 months ago

11.51.0-rc.0

7 months ago

11.51.0

6 months ago

11.51.1

6 months ago

11.51.2

6 months ago

11.25.2

9 months ago

11.48.0

9 months ago

11.25.1

10 months ago

11.44.0-rc.0

11 months ago

11.44.0

11 months ago

11.43.0

12 months ago

11.43.0-rc.0

12 months ago

11.42.0-rc.0

1 year ago

11.41.0-rc.0

1 year ago

11.42.0

1 year ago

11.41.0

1 year ago

11.40.0-rc.0

1 year ago

11.40.0

1 year ago

11.39.0

1 year ago

11.38.0

1 year ago

11.37.0

1 year ago

11.35.0

1 year ago

11.35.0-rc.0

1 year ago

11.36.0-rc.0

1 year ago

11.34.0

1 year ago

11.36.0

1 year ago

11.33.0

2 years ago

11.33.0-rc.0

2 years ago

11.31.0

2 years ago

11.32.0-rc.0

2 years ago

11.31.0-rc.0

2 years ago

11.30.0

2 years ago

11.32.0

2 years ago

11.28.0

2 years ago

11.30.0-rc.0

2 years ago

11.29.0

2 years ago

11.29.0-rc.0

2 years ago

11.28.0-rc.0

2 years ago

11.27.0

2 years ago

11.27.0-rc.0

2 years ago

11.24.0

2 years ago

11.26.1

2 years ago

11.26.0

2 years ago

11.26.2

2 years ago

11.25.0

2 years ago

11.25.0-rc.0

2 years ago

11.24.0-rc.0

2 years ago

11.26.0-rc.0

2 years ago

11.23.0

2 years ago

11.22.0

2 years ago

11.22.0-rc.0

2 years ago

11.21.0-rc.0

2 years ago

11.23.0-rc.0

2 years ago

11.21.0

2 years ago

11.20.0

3 years ago

11.19.0

3 years ago

11.18.0

3 years ago

11.17.0-rc.0

3 years ago

11.17.0

3 years ago

11.16.0

3 years ago

11.16.0-rc.0

3 years ago

11.15.0

3 years ago

11.15.0-rc.0

3 years ago

11.14.0

3 years ago

11.14.0-rc.0

3 years ago

11.13.0

3 years ago

11.13.0-rc.0

3 years ago

11.12.0

3 years ago

11.12.0-rc.0

3 years ago

11.11.0

3 years ago

11.10.0-rc.0

3 years ago

11.9.0-rc.0

3 years ago

11.9.0

3 years ago

11.10.0

3 years ago

11.11.0-rc.0

3 years ago

11.8.0

3 years ago

11.8.0-rc.0

3 years ago

11.7.0

3 years ago

11.7.0-rc.0

3 years ago

11.6.0

3 years ago

11.5.0

3 years ago

11.5.0-rc.0

3 years ago

11.4.0

3 years ago

11.4.0-rc.1

3 years ago

11.4.0-rc.0

3 years ago

11.3.0

3 years ago

11.3.0-rc.0

3 years ago

11.2.0

3 years ago

11.2.0-rc.1

3 years ago

11.2.0-rc.0

3 years ago

11.1.0

3 years ago

11.1.0-rc.1

3 years ago

11.1.0-rc.0

3 years ago

11.0.0

3 years ago

11.1.0-alpha.0

3 years ago

11.0.0-rc.3

3 years ago

11.0.0-rc.1

3 years ago

11.0.0-rc.0

3 years ago

10.18.0

4 years ago

10.18.0-rc.0

4 years ago

10.17.0

4 years ago

10.17.0-rc.0

4 years ago

10.16.0

4 years ago

10.16.0-rc.0

4 years ago

10.15.0

4 years ago

10.15.0-rc.1

4 years ago

10.15.0-rc.0

4 years ago

10.14.0

4 years ago

10.14.0-rc.0

4 years ago

10.13.0

4 years ago

10.13.0-rc.0

4 years ago

10.12.0

4 years ago

10.12.0-rc.0

4 years ago

10.11.0

4 years ago

10.11.0-rc.0

4 years ago

10.10.2

4 years ago

10.10.1

4 years ago

10.10.1-rc.0

4 years ago

10.10.0

4 years ago

10.10.0-rc.1

4 years ago

10.10.0-rc.0

4 years ago

10.9.2

4 years ago

10.9.2-rc.1

4 years ago

10.9.2-rc.0

4 years ago

10.9.1

4 years ago

10.9.1-rc.0

4 years ago

10.9.0

4 years ago

10.9.0-rc.1

4 years ago

10.9.0-rc.0

4 years ago

10.8.2

4 years ago

10.8.2-rc.0

4 years ago

10.8.1

4 years ago

10.8.1-rc.0

4 years ago

10.8.0

4 years ago

10.8.0-rc.0

4 years ago

10.8.0-alpha.0

4 years ago

10.7.0

5 years ago

10.7.0-rc.0

5 years ago

10.6.0-alpha.2

5 years ago

10.6.0-alpha.0

5 years ago

10.6.0

5 years ago