mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
.. | ||
__snapshots__ | ||
avatar-favicon.scss | ||
avatar-favicon.stories.tsx | ||
avatar-favicon.test.tsx | ||
avatar-favicon.tsx | ||
avatar-favicon.types.ts | ||
index.ts | ||
README.mdx |
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs'; import { AvatarBase } from '../'; import { AvatarFavicon } from './avatar-favicon'; # AvatarFavicon The `AvatarFavicon` is an image component that represents a dapp or third party service <Canvas> <Story id="components-componentlibrary-avatarfavicon--default-story" /> </Canvas> ## Props <ArgsTable of={AvatarFavicon} /> ### Size Use the `size` prop and the `AvatarFaviconSize` enum from `../../component-library` to change the size of `AvatarFavicon` Possible sizes include: - `AvatarFaviconSize.Xs` 16px - `AvatarFaviconSize.Sm` 24px - `AvatarFaviconSize.Md` 32px - `AvatarFaviconSize.Lg` 40px - `AvatarFaviconSize.Xl` 48px Defaults to `AvatarFaviconSize.MD` <Canvas> <Story id="components-componentlibrary-avatarfavicon--size-story" /> </Canvas> ```jsx import { AvatarFavicon, AvatarFaviconSize } from '../../component-library'; <AvatarFavicon size={AvatarFaviconSize.Xs} /> <AvatarFavicon size={AvatarFaviconSize.Sm} /> <AvatarFavicon size={AvatarFaviconSize.Md} /> <AvatarFavicon size={AvatarFaviconSize.Lg} /> <AvatarFavicon size={AvatarFaviconSize.Xl} /> ``` ### Src Use the `src` prop to set the image to be rendered of the `AvatarFavicon`. <Canvas> <Story id="components-componentlibrary-avatarfavicon--src" /> </Canvas> ```jsx import { AvatarFavicon } from '../../component-library'; <AvatarFavicon src="https://uniswap.org/favicon.ico" /> <AvatarFavicon src="https://1inch.exchange/assets/favicon/favicon-32x32.png" /> ``` ### Fallback Icon Props If there is no `src` then in that case an [icon](/docs/components-componentlibrary-icon--default-story) will be used as the fallback display and it can be customised via `fallbackIconProps`.