---
title: Examples
slug: wip/VmO8-examples
createdAt: 2023-12-22T09:35:41.323Z
---

# Examples

## Basic Usage

The Badge only needs a minimal amount of provided data to be used. Simply pass in a label text.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/wvOyKrR/b43248f9c2518af1ef61af22a5afbd37?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Prefix&#x20;

For optional prefixed content in the Badge component, you can include a cosmos-icon, cosmos-flag, cosmos-avatar, or custom content.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/oNVEjMo/5e795146e1f38224c637189228a7dcfb?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- Consider the prefixed content as a meaningful embellishment to the provided text.
- When combining the Badge component with the Avatar as prefix you should set the `size` of the Avatar to 'x-small'

## Kinds

There are 3 types of Badge kinds. Primary, Secondary and Cover-Up.

### Primary & Secondary

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/eYXVpod/1c763b81b9ba3c8f3b2942b46f8c01cd?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

### Cover-Up

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/XWGZygb/1e948e2d22659af78618769789a0d901?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- Consider when using `kind` 'cover-up' to ensure visibility of the badge no matter the background image.

## Shape

The shape of the Badge can be controlled via the `shape` property.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/WNmMQqN/098f6dc85b801b12db1c42bf9a2c275b?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

**Best Practices:**

- Use the 'pill' `shape` when in a B2C context.
- Use the 'rectangle' `shape` when in a B2B context.

## Link

The Badge can also be used as a link by setting the `href` property.

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/qBvxLEV/0916dc152ab6b88d615f04c5160b7b7a?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Appearance

:::Iframe{iframeHeight="0" code="<iframe title=&#x22;Embeded content from codepen.io&#x22; class=&#x22;no-border max-full-width full-height flex-grow&#x22; src=&#x22;https://codepen.io/redbulldesign/embed/OJqQyeG/f68ae58046cea3299f4bd9d443028342?default-tab=html%2Cresult&editable=true&theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

