1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00
metamask-extension/ui/components/component-library/avatar-favicon
2023-08-18 17:59:02 -07:00
..
__snapshots__ fix/AvatarFavicon to TS (#20430) 2023-08-15 14:35:18 -07:00
avatar-favicon.scss housekeeping for Avatar Favicon (#16931) 2023-01-11 21:41:06 +05:30
avatar-favicon.stories.tsx fix/AvatarFavicon to TS (#20430) 2023-08-15 14:35:18 -07:00
avatar-favicon.test.tsx fix/TagUrl to TS (#20519) 2023-08-18 17:59:02 -07:00
avatar-favicon.tsx fix/AvatarFavicon to TS (#20430) 2023-08-15 14:35:18 -07:00
avatar-favicon.types.ts fix/TagUrl to TS (#20519) 2023-08-18 17:59:02 -07:00
index.ts fix/AvatarFavicon to TS (#20430) 2023-08-15 14:35:18 -07:00
README.mdx fix/AvatarFavicon to TS (#20430) 2023-08-15 14:35:18 -07:00

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`.