# BadgedLogo

Marks a token or an app with a small badge on the corner of its logo.

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

Figma: [Elements/Badged Logo](https://www.figma.com/design/yE96kcymnNR88PJp6G1sPs?node-id=5606-2531) (`BadgedLogo.Root`)

## Overview

A badged logo insets a 44px logo in a 56px box and overlaps its lower trailing corner with a 20px badge. The badge holds one icon, such as an arrow that marks the destination of a transfer.

## Examples

### Token

```tsx
/** Renders a token logo with an arrow badge on the BadgedLogo page. @module */
import { BadgedLogo, TokenLogo } from '@tempoxyz/ds'
import { ArrowRight } from '@tempoxyz/ds/icons'

export function Demo() {
  return (
    <BadgedLogo.Root>
      <TokenLogo symbol="USDC" />
      <BadgedLogo.Badge>
        <ArrowRight />
      </BadgedLogo.Badge>
    </BadgedLogo.Root>
  )
}
```

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

### App

An app without artwork takes a tile with the first letter of its name.

```tsx
/** Renders an app tile with an arrow badge on the BadgedLogo page. @module */
import { BadgedLogo } from '@tempoxyz/ds'
import { ArrowRight } from '@tempoxyz/ds/icons'

export function Demo() {
  return (
    <BadgedLogo.Root>
      <BadgedLogo.Tile>A</BadgedLogo.Tile>
      <BadgedLogo.Badge>
        <ArrowRight />
      </BadgedLogo.Badge>
    </BadgedLogo.Root>
  )
}
```

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

## Anatomy

Import the component and assemble its parts.

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

<BadgedLogo.Root>
  <BadgedLogo.Tile />
  <BadgedLogo.Badge />
</BadgedLogo.Root>
```

## Guidelines

### When to Use

* Mark the token or the app at one end of a transfer, such as the destination of a send.

### When Not to Use

* Use [TokenLogo](/docs/components/token-logo) for a token without a badge.
* Use [Avatar](/docs/components/avatar) for a person, a contact, or a wallet.
* Use [IconTile](/docs/components/icon-tile) for one icon above the title of a modal.

### Put the Logo First and the Badge Last

Pass one logo, then one `BadgedLogo.Badge`. The root sizes the logo to 44px, so leave its size unset.

### Use One Small Icon in the Badge

The badge centers one 12px icon in the primary color. Do not put text or a second icon in it.

## Content

Fill a `BadgedLogo.Tile` with the first letter of the app's name, in uppercase.

## Accessibility

A badged logo renders `<span>` elements with no role and takes no focus.

* **Logo (img):** A token logo with `alt` announces its name.
* **Badge (aria-hidden):** An icon without `aria-label` stays hidden.
* **Meaning in Text:** Name what the badge means in text beside it.

## Related

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

Use for a token logo without a badge.

[Avatar](/docs/components/avatar)

Use for people, contacts, and wallets.

[IconTile](/docs/components/icon-tile)

Use for one icon above the title of a modal.
