---
title: Examples
slug: wip/MQ6f-examples
createdAt: 2023-11-21T11:22:26.104Z
---

# Examples

:::hint{type="warning"}
💡 Pro Tip

For A11y support, it's essential to provide an `aria-label` property for the Chip, formatted as "Dismiss + &#x7B;Content}".
:::

## Basic Usage

The Chip only needs a minimal amount of provided data to be used. Simply pass in a label text and the relevant `aria-label` 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/VwgGXqx/af3a7c6798acd48b4096dd53d4a19b67?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Prefix&#x20;

For optional prefixed content in the Chip component, you can include cosmos-flags, icons, avatars, 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/BaMOxoB/acd82ad93ac497802614cc44d238cf57?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;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.

## Shape

The shape of the Chip 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/poGOVeR/23b5e6f673fc5fe036ccba9db5fb43f5?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;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.

## 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/qBgMYpJ/0aa134617b81ae700a9a8c081202f89f?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

## Listening to Events

The Chip supports listening to a `dismiss` event which is triggered when the dismiss button is clicked.&#x20;

:::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/dyaqerB/147f6a301c33f586a7eef62347b58972?defaultTab=html%2Cresult&#x26;amp;editable=true&#x26;amp;theme-id=39623&#x22; height=&#x22;244px&#x22; loading=&#x22;lazy&#x22;></iframe>"}

:::

#

