import { IconBrand } from '@uhg-abyss/web/ui/IconBrand';<IconBrand icon="home" size="$web.semantic.sizing.icon.illustrative.sm"/>Usage
Use Icon to implement custom SVG icons.
Use IconSymbol to implement Google's Material Design based icons.
Use IconBrand to implement Optum brand icons and adopt their properties.
An icon is a graphical representation of an object, place or idea. Whereas, an IconBrand clearly communicate a brand's personality and identity.
Icons
Use the icon property to adjust which icon is being selected.
Note: When using TypeScript, the icon property only accepts valid icon names. If an invalid icon name is provided, an error will be thrown. To verify that a given value is a valid icon name, use the isValidAssetName tool or use the ValidIconBrandName type:
import { ValidIconBrandName } from '@uhg-abyss/web/ui/IconBrand';
let iconName: ValidIconBrandName;Size
Use the size property to adjust the size of an icon by setting it to a specific number. The default size is set to 24.
IconBrand Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
brand | "uhc" | "optum" | "uhg" | - | - | The brand of the icon If not specified here, the brand will be determined by the theme set in the application's ThemeProvider or AbyssProvider. |
className | string | - | - | CSS class name to apply to each element within the component |
css | Abyss.CSSProperties | Partial<Record<`abyss-${T}`, Abyss.CSSProperties>> | - | - | Object containing CSS styling to apply; uses the classes listed in the "Integration" tab of the component's documentation |
data-testid | string | - | - | Suffix used to create a unique ID used for automated testing |
disableDefaultProviderProps | boolean | false | - | If set to true, the component will not use the DefaultPropsProvider values. If you aren’t using the DefaultPropsProvider, this prop can be ignored. |
icon | ValidIconBrandName | - | The icon name | |
size | string | number | 24 | - | The size of the icon |
title | string | - | - | The icon title |
variant | "twotonedarkcircle" | "twotonelightcircle" | "twotone" | "onetonedarkcircle" | "onetonelightcircle" | "onetone" | 'twotonedarkcircle' | - | The variant of the icon |
IconBrand Classes
| Class Name | Description |
|---|---|
| .abyss-icon-brand | IconBrand root element |
| .abyss-icon-brand-wrapper | IconBrand wrapper element when variant requires a circle background |
Meaningful or Control Icons
If the icon is being used in a setting where it is the only element providing meaning, then that same meaning should be conveyed to screen reader users. The below implementation provides examples of situations in which the title property is required and should describe the purpose of the image.
Example 1: An alert icon is used to convey a sense of urgency; there is adjacent text (“There is a data outage”) but the text doesn't include any words that convey urgency. So, in this case, the icon should have a text alternative such as “Alert” or “Warning”.
Example 2: An “X” material icon is used as a close button on a modal dialog. There is no adjacent text, so the icon should have a text alternative of “close” or “close window”.
Decorative Icons
If the icon is being used in a setting in which it just a decorative element (which is the default case for icons), then the icon should be ignored by screen readers. The below implementation provides example of which situations would be classified as decorative.
Example 1: An alert icon is used next to an urgent message and the word “Alert” is included in the adjacent text. In this case, the icon becomes decorative in nature and should be ignored by screen readers.
Example 2: An “X” material icon is used as a close button on a modal dialog; the word “Close” appears to the right of the button. In this case, the icon should be considered decorative and ignored by screen readers.
Useful Resources for Image Accessibility
Icon, IconBrand, and IconSymbol examples
Samples of all three icon components with and without titles (alt text):
Brand Icons
Abyss uses Brand's branded iconography that is designed to aid wayfinding, draw attention and support messaging.
The source for these design icons can be found in the Brand Icons Library.