1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-26 12:29:06 +01:00
metamask-extension/ui/components/component-library/avatar-account
George Marshall 5d17f86e02
Update Text import paths: component library/ (#19987)
* Updating component-librar import paths

* Updating snapshots

* Updates to AvatarBase story

* Updates to avatar and checkbox

* Updating last of the deprecated import paths

* Updating component-library snapshots from button-base

* Updating snapshots from rest of codebase to do with button-base

* Removing unneeded CSS

* Updating snapshots
2023-07-17 14:00:16 -07:00
..
__snapshots__ Update Text import paths: component library/ (#19987) 2023-07-17 14:00:16 -07:00
avatar-account.js Updating Avatar components to forward refs (#18678) 2023-04-21 08:51:34 -07:00
avatar-account.scss avatar account housekeeping (#16930) 2023-01-09 16:38:43 -08:00
avatar-account.stories.js Updating AvatarAccount objects to enums (#17727) 2023-03-10 12:12:55 -08:00
avatar-account.test.js Updating Avatar components to forward refs (#18678) 2023-04-21 08:51:34 -07:00
avatar-account.types.ts Updating AvatarAccount objects to enums (#17727) 2023-03-10 12:12:55 -08:00
index.js Updating AvatarAccount objects to enums (#17727) 2023-03-10 12:12:55 -08:00
README.mdx Updating AvatarAccount objects to enums (#17727) 2023-03-10 12:12:55 -08:00

import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';

import { AvatarAccount } from './avatar-account';
import { AvatarBase } from '../';

# AvatarAccount

The `AvatarAccount` is a type of avatar reserved for representing accounts.

<Canvas>
  <Story id="components-componentlibrary-avataraccount--default-story" />
</Canvas>

## Props

The `AvatarAccount` accepts all props below as well as all [Box](/docs/components-ui-box--default-story#props) component props

<ArgsTable of={AvatarAccount} />

`AvatarAccount` accepts all [AvatarBase](/docs/components-componentlibrary-avatarbase--default-story))
component props

<ArgsTable of={AvatarBase} />

### Size

Use the `size` prop and the `AvatarAccountSize` enum from `../../component-library` to change the size of `AvatarAccount`

Possible sizes include:

- `AvatarAccountSize.Xs` 16px
- `AvatarAccountSize.Sm` 24px
- `AvatarAccountSize.Md` 32px
- `AvatarAccountSize.Lg` 40px
- `AvatarAccountSize.Xl` 48px

Defaults to `AvatarAccountSize.MD`

<Canvas>
  <Story id="components-componentlibrary-avataraccount--size" />
</Canvas>

```jsx
import { AvatarAccount, AvatarAccountSize } from '../ui/component-library';

<AvatarAccount size={AvatarAccountSize.Xs} />
<AvatarAccount size={AvatarAccountSize.Sm} />
<AvatarAccount size={AvatarAccountSize.Md} />
<AvatarAccount size={AvatarAccountSize.Lg} />
<AvatarAccount size={AvatarAccountSize.Xl} />
```

### Variant

Use the `variant` prop and the `AvatarAccountVariant` enum from `../../component-library` to change between jazzicon and blockies variants.

<Canvas>
  <Story id="components-componentlibrary-avataraccount--variant" />
</Canvas>

```jsx
import { AvatarAccount, AvatarAccountVariant } from '../ui/component-library';

<AvatarAccount variant={AvatarAccountVariant.Jazzicon} />
<AvatarAccount variant={AvatarAccountVariant.Blockies} />
```

### Address

Use the required `address` for generating images

<Canvas>
  <Story id="components-componentlibrary-avataraccount--address" />
</Canvas>

```jsx
import { AvatarAccount, AvatarAccountVariant } from '../ui/component-library';

<AvatarAccount variant={AvatarAccountVariant.Jazzicon} address="0x5CfE73b6021E818B776b421B1c4Db2474086a7e1" />
<AvatarAccount variant={AvatarAccountVariant.Blockies} address="0x0" />
```