1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/ui/components/component-library/picker-network
Garrett Bear 0bf6aeb5f5
icon audit, remove xxs icon size (#17089)
* icon audit, remove xxs icon size

* update icon file names and snapshots

* remove unused icon- code and fix icons with slash issue

* close icon fix

* remove icons id

* update snapshot

* font awesome icon list

* remove font awesome

* fix linting issue
2023-01-24 09:39:46 -08:00
..
__snapshots__ icon audit, remove xxs icon size (#17089) 2023-01-24 09:39:46 -08:00
index.js Added Picker Network Component (#16340) 2022-11-09 16:31:51 -08:00
picker-network.js housekeeping for avatar network (#16663) 2022-12-15 22:58:42 +05:30
picker-network.scss updated background color for picker network (#16466) 2022-11-18 22:29:25 +05:30
picker-network.stories.js Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30
picker-network.test.js housekeeping for picker-network (#16982) 2023-01-05 15:30:42 -08:00
README.mdx Added storybook check to CI (#17092) 2023-01-21 00:57:46 +05:30

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

import { PickerNetwork } from './picker-network';

# PickerNetwork

The `PickerNetwork` is used for the action of changing a network.

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

## Props

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

<ArgsTable of={PickerNetwork} />

### Label

Use the `label` prop for the text content of the `PickerNetwork` component

<Canvas>
  <Story id="components-componentlibrary-pickernetwork--label" />
</Canvas>

```jsx
import { PickerNetwork } from '../../ui/component-library';
<PickerNetwork label="Arbitrum One" />
<PickerNetwork label="Polygon Mainnet" />
<PickerNetwork label="Optimism" />
```

### Src

Use the `src` prop with an image url to render the `AvatarNetwork`. Use the `avatarNetworkProps` to pass additional props to the `AvatarNetwork` component.

<Canvas>
  <Story id="components-componentlibrary-pickernetwork--src" />
</Canvas>

```jsx
import { PickerNetwork } from '../../ui/component-library';
<PickerNetwork src="./images/arbitrum.svg" />
<PickerNetwork src="./images/matic-token.png" />
<PickerNetwork src="./images/optimism.svg" />
```