Icon

Draws attention to specific actions and features.

Icon

To implement Icon component into your project you need to know its name. You can find it in the list of all icons. Then just add an import of the icon:

import Airplane from "@kiwicom/orbit-components/lib/icons/Airplane";

After adding import into your project you can use it simply like:

<Airplane />

Props

Table below contains all types of the props available for icons in general.

NameTypeDefaultDescription
classNamestringThe optional className of Icon.
colorenumcurrentColorThe color of the Icon.
customColorstringThe customColor of the Icon. See Functional specs
dataTeststringOptional prop for testing purposes.
sizeenum"medium"The size of the Icon.
reverseOnRtlbooleanfalseIf true, the icon will be reversed if theme.rtl is set to true.
ariaHiddenbooleanAdds prop aria-hidden to an element, useful for screenreaders.
ariaLabelstringAdds prop aria-label to an element, useful for screenreaders.

enum

colorsize
"primary""small"
"secondary""medium"
"tertiary""large"
"info"
"success"
"warning"
"critical"

Functional specs

  • If you don’t pass customColor or color prop to Icon, it will inherit color from parent container with currentColor by default.

Accessibility

  • If an icon is used standalone meaning it conveys information by itself use ariaLabel to help screen readers understand the content.
  • If an icon is marked or already labeled by surrounding content, use ariaHiddento hide icon from screen readers.

iconFont

Icon font is available in @kiwicom/orbit-components/orbit-icons-font/orbit-icons folder in these formats ttf, woff2, svg

import iconFont from "@kiwicom/orbit-components/orbit-icons-font/orbit-icons.woff2";