# NetworkLogo

Shows the logo of the network a token lives on.

[View source and API](https://github.com/tempoxyz/ds/blob/main/src/web/components/NetworkLogo.tsx)

## Overview

A network logo renders a network's artwork as an inline SVG, cropped to a circle. The artwork keeps the network's brand colors in both color schemes.

## Examples

### Basic

```tsx
import { NetworkLogo, style } from '@tempoxyz/ds'

export function Demo() {
  return (
    <div {...styles.row()}>
      <NetworkLogo network="tempo" />
      Tempo
    </div>
  )
}

namespace styles {
  export const row = style({ alignItems: 'center', display: 'flex', gap: '8' })
}
```

[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/NetworkLogo/Basic.tsx)

### Network

Set `network` to `base`, `ethereum`, `hyperevm`, `polygon`, `solana`, or `tempo`.

```tsx
import { NetworkLogo, style } from '@tempoxyz/ds'

const networks = [
  ['base', 'Base'],
  ['ethereum', 'Ethereum'],
  ['hyperevm', 'HyperEVM'],
  ['polygon', 'Polygon'],
  ['solana', 'Solana'],
  ['tempo', 'Tempo'],
] as const

export function Demo() {
  return (
    <div {...styles.grid()}>
      {networks.map(([network, label]) => (
        <div key={network} {...styles.row()}>
          <NetworkLogo network={network} />
          {label}
        </div>
      ))}
    </div>
  )
}

namespace styles {
  export const grid = style({ display: 'grid', gap: '12' })

  export const row = style({ alignItems: 'center', display: 'flex', gap: '8' })
}
```

[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/NetworkLogo/Network.tsx)

### Size

Set `size` to `medium` (20px, default) or `large` (32px).

```tsx
import { NetworkLogo, style } from '@tempoxyz/ds'

export function Demo() {
  return (
    <div {...styles.row()}>
      <NetworkLogo network="ethereum" size="medium" />
      <NetworkLogo network="ethereum" size="large" />
    </div>
  )
}

namespace styles {
  export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
}
```

[View example source](https://github.com/tempoxyz/ds/blob/main/docs/src/examples/demos/NetworkLogo/Size.tsx)

## Anatomy

Import the component and assemble its parts.

```tsx
import { NetworkLogo } from '@tempoxyz/ds'

<NetworkLogo />
```

## Guidelines

### When to Use

* Show which network a token, an address, or a deposit belongs to, such as in a Receive flow or a network picker.

### When Not to Use

* Use [TokenLogo](/docs/components/token-logo) for the token itself.
* Use [Identicon](/docs/components/identicon) for an account address.
* Use [IconTile](/docs/components/icon-tile) for a feature or category icon.

### Name the Network

Many people don't know every network's logo.

**Do:** Show the network name beside each logo.

```tsx
/**
 * Do example for "Name the Network" on the NetworkLogo page.
 * Show the network name beside each logo.
 * @module
 */
import { NetworkLogo, style } from '@tempoxyz/ds'

const networks = [
  ['tempo', 'Tempo'],
  ['base', 'Base'],
  ['ethereum', 'Ethereum'],
] as const

/** Renders the static preview, which the guideline card shows inert. */
export function Demo() {
  return (
    <div {...styles.list()}>
      {networks.map(([network, label]) => (
        <div key={network} {...styles.row()}>
          <NetworkLogo network={network} size="large" />
          <span {...styles.name()}>{label}</span>
        </div>
      ))}
    </div>
  )
}

namespace styles {
  export const list = style({ display: 'grid', gap: '12' })

  export const name = style({ color: 'content.primary', typography: 'body.b2Strong' })

  export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
}
```

**Don't:** Ask people to tell networks apart by logo alone.

```tsx
/**
 * Don't example for "Name the Network" on the NetworkLogo page.
 * Logos alone ask people to recognize every network's brand.
 * @module
 */
import { NetworkLogo, style } from '@tempoxyz/ds'

/** Renders the static preview, which the guideline card shows inert. */
export function Demo() {
  return (
    <div {...styles.row()}>
      <NetworkLogo network="tempo" size="large" />
      <NetworkLogo network="base" size="large" />
      <NetworkLogo network="ethereum" size="large" />
    </div>
  )
}

namespace styles {
  export const row = style({ alignItems: 'center', display: 'flex', gap: '12' })
}
```

### Match Size to the Context

* **Medium (20px):** Beside a network name in a value or chip.
* **Large (32px):** In network rows and network pickers.

### Keep the Brand Artwork

**Do:** Use the logo as it renders, in its own colors.

```tsx
<NetworkLogo network="ethereum" size="large" />
```

**Don't:** Recolor the logo, or redraw it as a colored circle with a letter.

```tsx
<span
  style={{
    alignItems: 'center',
    background: '#627eea',
    borderRadius: 999,
    color: 'white',
    display: 'inline-flex',
    font: '600 14px Inter',
    height: 32,
    justifyContent: 'center',
    width: 32,
  }}
>
  E
</span>
```

## Accessibility

A network logo renders an `<svg>` that is hidden from screen readers by default. It is not interactive and takes no focus.

### Semantics

* **Root (aria-hidden):** Hidden from screen readers, so the visible name beside it is read once.
* **Named Logo (aria-label):** An `aria-label` gives the logo the `img` role, so screen readers announce it.

### Your Responsibilities

* **Name a Standalone Logo (aria-label):** If no visible text names the network, pass the network name as `aria-label`.

## Related

[TokenLogo](/docs/components/token-logo)

Use for token logos.

[AssetChip](/docs/components/asset-chip)

Use for listing the assets a network supports.

[ListGroup](/docs/components/list-group)

Use for network lists.

[Blockchain Values](/docs/patterns/blockchain-values)

Covers tokens, networks, and addresses.
