import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { AvatarBase } from '../'; import { AvatarIcon } from './avatar-icon'; # AvatarIcon The `AvatarIcon` is an avatar component that renders only an icon inside and is built off the [AvatarBase](/docs/components-componentlibrary-avatarbase--default-story)) component ## Props The `AvatarIcon` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) component props `AvatarIcon` accepts all [AvatarBase](/docs/components-componentlibrary-avatarbase--default-story)) component props ### Size Use the `size` prop and the `SIZES` object from `./ui/helpers/constants/design-system.js` to change the size of `AvatarIcon` Optional: `AVATAR_ICON_SIZES` from `./ui/components/component-library` object can be used instead of `SIZES` Possible sizes include: - `SIZES.XS` 16px - `SIZES.SM` 24px - `SIZES.MD` 32px - `SIZES.LG` 40px - `SIZES.XL` 48px Defaults to `SIZES.MD` ```jsx import { SIZES } from '../../../helpers/constants/design-system'; import { AvatarIcon, ICON_NAMES } from '../ui/component-library'; ``` ### Icon Name\* Use the required `iconName` prop with `ICON_NAMES` object from `./ui/components/component-library` to select icon Use the [IconSearch](/story/components-componentlibrary-icon--default-story) story to find the icon you want to use. ```jsx import { AvatarIcon, ICON_NAMES } from '../ui/component-library'; ``` ### Color and Background Color Use the `color` and `backgroundColor` props with the `COLORS` object from `./ui/helpers/constants/design-system.js` to change the icon color and background color of `AvatarIcon` `color` default: `COLORS.COLORS.PRIMARY_DEFAULT` `backgroundColor` default: `COLORS.COLORS.PRIMARY_MUTED` ```jsx import { COLORS } from '../../../helpers/constants/design-system'; import { AvatarIcon } from '../ui/component-library'; ```