---
title: Ribbon
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { Ribbon as WebDocs } from 'docs/@telus-uds/components-web'
import { Box } from '@telus-uds/components-web'
import AvailableOnWebOnly from '../../partials/_platform-considerations-web-only.mdx'

# Ribbon

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

```jsx live
<Ribbon>TELUS Ribbon</Ribbon>
```

## Introduction

Ribbon is used to display promotional content and focus attention.

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

## Guidance

- Use Ribbon to display promotional content such as a sale or special feature
- Use Ribbon to visually focus attention
- Use `top` and `left` props to align Ribbon within the container (if either is set, the Ribbon will be absolutely positioned)
- Add text only
- Available in 2 variants: default and wrap (visually appear as if it is wrapping around a container.

### Accessibility

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

### Platform considerations

<AvailableOnWebOnly />

## Props

<PropsTable web={WebDocs} />

## Tokens

<TokensTable web={WebDocs} component="Ribbon" />

## Variants

### Purpose

#### Default

```jsx live
<Ribbon variant={{ purpose: 'default' }}>TELUS Ribbon</Ribbon>
```

#### Editorial

```jsx live
<Ribbon variant={{ purpose: 'editorial' }}>TELUS Ribbon</Ribbon>
```

#### Offer

```jsx live
<Ribbon variant={{ purpose: 'offer' }}>TELUS Ribbon</Ribbon>
```

#### Subtle

```jsx live
<Ribbon variant={{ purpose: 'subtle' }}>TELUS Ribbon</Ribbon>
```

### Wrap

#### Default

```jsx live
<Ribbon wrap variant={{ purpose: 'default' }}>
  TELUS Ribbon
</Ribbon>
```

#### Editorial

```jsx live
<Ribbon wrap variant={{ purpose: 'editorial' }}>
  TELUS Ribbon
</Ribbon>
```

#### Offer

```jsx live
<Ribbon wrap variant={{ purpose: 'offer' }}>
  TELUS Ribbon
</Ribbon>
```

#### Subtle

```jsx live
<Ribbon wrap variant={{ purpose: 'subtle' }}>
  TELUS Ribbon
</Ribbon>
```

### Offset position

- Position the Ribbon using `top` and `left` by applying a negative value
- The container holding the Ribbon must have `position: relative` for `top` and `left` to work

#### Position in a box

```jsx live
<Box flex={1} variant={{ background: 'light' }} space={4}>
  <Ribbon left={-8} top={-12} wrap={true}>
    Limited time offer
  </Ribbon>
  <Typography block variant={{ size: 'eyebrow' }}>
    Apple
  </Typography>
  <Typography block variant={{ size: 'h1' }}>
    iPhone 15
  </Typography>
  <Typography block>Experience Apple iPhone 15 on Canada's fastest network</Typography>
</Box>
```

#### Position in a Card

```jsx live
<>
  <Spacer space={2} />
  <div style={{ position: 'relative' }}>
    <Ribbon left={-8} top={-12} wrap={true}>
      Limited time offer
    </Ribbon>
    <Card>
      <Typography block variant={{ size: 'eyebrow' }}>
        Apple
      </Typography>
      <Typography block variant={{ size: 'h1' }}>
        iPhone 15
      </Typography>
      <Typography block>Experience Apple iPhone 15 on Canada's fastest network</Typography>
    </Card>
  </div>
</>
```

## Feedback

<Feedback component="Ribbon" />
