---
title: Badge
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { Badge, Box, Card, Typography } from '@telus-uds/components-web'
import { Badge as WebDocs } from 'docs/@telus-uds/components-web'
import { Badge as BaseDocs } from 'docs/@telus-uds/components-base'
import AvailableOnBoth from '../../partials/_platform-considerations-both.mdx'

# Badge

<LibraryInfo figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2F4zJn2Qn6uXOqPP1GVDipy6%2Fbranch%2FuUiGOlTE24TPAGjShzizNs%2F%25F0%259F%258D%2580-Allium-Components%3Fnode-id%3D7819%253A163893" />

```jsx live
<Badge>TELUS Badge</Badge>
```

## Introduction

Badge is used to bring visual attention to a feature, editorial category, or
marketing content such as offers or campaigns

[Follow the appropriate instructions](importing-components) to add this component in to your app.

## Guidance

- Add text only
- Available in 2 variants: `default`, `editorial`
- Use `default` variant to highlight features
- Use `editorial` variant to identify editorial content such as category
- Available in 2 styles (`purpose`): `default` and `outline`
- Use `default` to focus attention
- Use `outline` to highlight but minimize attention
- Reduce visual noise
- Limit using up to 2 badges and single row per object
- Limit using up to 3 gradients per page, 1 gradient per object
- May use with ribbons
- Don’t place badge above the `Eyebrow` or `Image`, or between objects that below together

### Accessibility

Badge has no semantic role or aria attributes applied by default.

### Platform considerations

<AvailableOnBoth />

## Props

<PropsTable web={WebDocs} base={BaseDocs} />

## Tokens

<TokensTable web={WebDocs} base={BaseDocs} component="Badge" />

## Variants

### Size

Badge available in `compact` (small), `default` sizes.

#### Compact

```jsx live
<>
  <Badge variant={{ size: 'compact' }}>Compact</Badge>
  <Badge variant={{ purpose: 'editorial', size: 'compact' }}>Editorial</Badge>
  <Badge variant={{ purpose: 'offer', size: 'compact' }}>Offer</Badge>
  <Badge variant={{ purpose: 'subtle', size: 'compact' }}>Subtle</Badge>
</>
```

#### Default

```jsx live
<>
  <Badge>Default</Badge>
  <Badge variant={{ purpose: 'editorial' }}>Editorial</Badge>
  <Badge variant={{ purpose: 'offer' }}>Offer</Badge>
  <Badge variant={{ purpose: 'subtle' }}>Subtle</Badge>
</>
```

### Purpose

#### Editorial

Use `editorial` variant to identify editorial content, such as category:

```jsx live
<Badge variant={{ purpose: 'editorial' }}>Editorial</Badge>
```

#### Offer

Use `offer` variant to highlight marketing offers, savings and campaigns:

```jsx live
<Badge variant={{ purpose: 'offer' }}>Offer</Badge>
```

#### Subtle

Use `subtle` variant to diminish visual attention

```jsx live
<Badge variant={{ purpose: 'subtle' }}>Subtle</Badge>
```

Note: This variant is only available for the web platform.

### Outline

Use `outline` variant to highlight, but minimize attention:

```jsx live
<>
  <Badge variant={{ outline: true }}>Outline</Badge>
  <Badge variant={{ purpose: 'editorial', outline: true }}>Editorial + Outline</Badge>
  <Badge variant={{ purpose: 'offer', outline: true }}>Offer + Outline</Badge>
  <Badge variant={{ purpose: 'subtle', outline: true }}>Subtle + Outline</Badge>
</>
```

### Alternative

Use `alternative` variant to match marketing campaigns:

```jsx live
<>
  <Badge variant={{ alternative: true }}>Outline</Badge>
</>
```

Note: This variant is only available for the web platform.

### Inverse

Use `inverse` variant while rendering badge on darker backgrounds:

```jsx live
<Box variant={{ background: 'darkest' }} space={3}>
  <Badge variant={{ inverse: true }}>Inverse</Badge>
</Box>
```

## Feedback

<Feedback component="Badge" />
