Icons
EuiIcon is a handy component for using our custom glyphs and logos. The type
prop accepts either an enumerated name from one of the sets below, a location to a custom SVG asset, or a React Element.
Component
Accessibility recommendation
If possible, provide a descriptive title based on the icon use. If no title is provided, the icon is considered purely decorative, and it will default to aria-hidden=true
.
Usage
Sizes
Use the size
prop to automatically size your icons. Medium is the default, and will output a 16x16
icon.
Colors
The default behavior of icons is to inherit from the text color. You can use the color
prop to assign a custom color which accepts a named color from our palette or a validΒ CSS color data typeΒ which will be passed down through the inline-style fill
Β property. We recommend relying on the EUI named color palette unless the custom color is initiated by the user (like as a graph color).
Two-tone icons, like our app style icons, will behave similarly to normal glyphs when provided a specific color by applying the color to all the shapes within. You can force the icon to match the parent's text color by passing color="inherit"
to the icon.
Glyphs
Glyphs are small, monochromatic icons that typically should always use the default size of size="m"
. They are named according to their appearance or the action they represent. For example, star
, play
, etc.
If you would like to contribute to our growing list of glyphs, you can follow these guidelines.
Editor controls
Editor icons relate to the visual styling of elements and are commonly used within EuiButtonGroup components.
Elastic logos
These logos are restricted in use to Elastic products or when referencing Elastic products. They are multi-color with some internal paths having a class of .euiIcon__fillNegative
to handle flipping colors for dark mode. The only other colors most of them support are ghost and text which turn them into a solid shape.
Apps
App logos are logos for Elastic Apps, and can contain multiple colors. Normally the Elastic Design team creates those icons. They are not meant to be used outside of Elastic, because they represent our apps. App logos are usually displayed at 32x32
or above and can contain multiple colors.
Our set of App Icons are a subset of what the Elastic Design team provides. If you require an icon from that set which EUI does not currently provide, please open a Feature Request for the EUI team to add it.
Machine learning icons
Machine learning has some specific icons for job creation. Again, these are made for 32x32
.
Tokens
Tokens are most commonly used to visually signify field or code types. An EuiToken accepts any valid EuiIcon as its iconType
property. However, icons designed specifically for use in the EuiToken are prefixed with "token" in their name and have pre-defined styles.
Custom tokens
By default, an iconType
with the token prefix (i.e. those listed above) will have predefined styles. However, any valid iconType
can be passed and, in either case, the shape
, size
, color
, and fill
can be customized.
tsx code block: