Get started
Carbon icons are provided through a set of packages allowing the use of icons in multiple frameworks. Icons are supported in vanilla, React, Angular, and Vue.
To install @carbon/icons-react in your project, you will need to run the following command using npm:
If you prefer Yarn, use the following command instead:
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. Icons default to size 16. You can change the size of the icon by adding the size prop:
Note: if you would like to find the import path for an icon, you can reference our Icon Library
Focus and aria-label
By default, the icon components from @carbon/icons-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:
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:
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.