import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { AvatarToken } from './avatar-token'; # AvatarToken The `AvatarToken` is a component responsible for display of the image of a given token ## Props The `AvatarToken` accepts all props below as well as all [Box](/docs/components-componentlibrary-box--docs#props) component props ### Size Use the `size` prop and the `AvatarTokenSize` enum to change the size of `AvatarToken`. Defaults to `IconSize.Sm` Possible sizes include: - `AvatarTokenSize.Xs` 16px - `AvatarTokenSize.Sm` 24px - `AvatarTokenSize.Md` 32px - `AvatarTokenSize.Lg` 40px - `AvatarTokenSize.Xl` 48px Defaults to `AvatarTokenSize.Md` The fallback display of the `AvatarToken` is a circle with the initial letter of the network name. The size of the initial letter is calculated based on the size of the `AvatarToken` component. ```jsx import { AvatarToken, AvatarTokenSize } from '../../component-library'; ``` ### Name Use the `name` prop to set the initial letter of the `AvatarToken`. This will be used as the fallback display if no image url is passed to the `src` prop. Use `Text` component props to change the `variant`, `font-weight`, `font-family`, etc. ```jsx import { AvatarToken } from '../../component-library'; ; ``` ### Src Use the `src` prop to set the image to be rendered of the `AvatarToken`. ```jsx import { AvatarToken } from '../../component-library'; ``` ### Show Halo Use the `showHalo` prop to display the component with halo effect. Only works if an image url is supplied to `src` ```jsx import { AvatarToken } from '../../component-library'; ; ``` ### Color, Background Color And Border Color Use the `color`, `backgroundColor` and `borderColor` props to set the text color, background-color and border-color of the `AvatarToken`. ```jsx import { TextColor, BackgroundColor, BorderColor, } from '../../../helpers/constants/design-system'; import { AvatarToken } from '../../component-library'; G S ```