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 `AvatarIcon` accepts all [AvatarBase](/docs/components-componentlibrary-avatarbase--default-story)) component props ### Size Use the `size` prop and the `AvatarIconSize` enum to change the size of `AvatarIcon` Possible sizes include: - `AvatarIconSize.Xs` 16px - `AvatarIconSize.Sm` 24px - `AvatarIconSize.Md` 32px - `AvatarIconSize.Lg` 40px - `AvatarIconSize.Xl` 48px Defaults to `AvatarIconSize.Md` ```jsx import { AvatarIcon, AvatarIconSize } from '../../component-library'; ``` ### Icon Name\* Use the required `iconName` prop with `IconName` enum 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, IconName } from '../../component-library'; ``` ### Color and Background Color Use the `color` and `backgroundColor` props with the `IconColor` and `BackgroundColor` object from `./ui/helpers/constants/design-system.js` to change the icon color and background color of `AvatarIcon` `color` default: `IconColor.primaryDefault` `backgroundColor` default: `BackgroundColor.primaryMuted` ```jsx import { BackgroundColor, IconColor } from '../../../helpers/constants/design-system'; import { AvatarIcon } from '../../component-library'; ```