---
title: Usage
slug: wip/usage
createdAt: 2023-09-29T06:18:29.808Z
---

# Usage

This guide outlines the best practices for utilizing the Icon component in our design system, ensuring consistency and functionality across user interfaces.

An Icon should:

- Help make the information more glanceable.
- Be used with a purpose, not only for decoration.
- Be used as non-interactive component. If icons need to be interactive, use the [Button](https://cosmos.redbull.design/wip/button) component or wrap it within a button or a tag.
- Be used consistently in groups, sharing the same style – either outlined or filled.
- Be vertically center-aligned to text when used in conjunction.
- Have their size set to match the line height of text when used in conjunction.
- Match the text color when used together, such as in active, error or disabled states.
- Maintain each shape's originally defined color (`text-dark-default`). When customized, color of the shapes can be overridden.

If you need an icon that's not available in the system or to unblock your project, please submit a request through [Echo](https://echo.redbull.design/). For uncommon icons, like those for third-party vendors, consider creating them locally, ensuring they f[ollow the guidelines](https://cosmos.redbull.design/CZuj-guidelines).

## Using in Code

### NPM package

All icons are published as part of the `@cosmos/foundation` NPM package. All SVG source files are optimized and located in `@cosmos/foundation/primitives/icons`.

### Static File Host

Icons are hosted on Cosmos' static file host and can be accessed via URL.

```html
<!-- Accessing an icon directly from the static host -->
<img src="https://rbds-static.redbull.com/@cosmos/foundation/latest/icons/gravity-icon-can.svg">
```

### Exported list of all available icons

For creating lists of available icons, dynamically generating icon pickers, or implementing other custom use cases, the Foundation also exports a full JSON list of all available icons.

```javascript
import { cosmosIconCodes } from "@cosmos/foundation";
```

## Using in Figma

Icons are available as **Components** from the **Foundation** library, accessible directly from the Asset Panel once the library is enabled.

::Image[]{src="https://api.archbee.com/api/optimize/Kp4perMrWxGYfa_PWfi7H/wkWsYIbAPzm0XEEo-9jya_dvjog27nnfaxbxsumuhyq.png" size="66" width="1140" height="1688" position="center" showCaption="false"}

## Arrow Icons Usage

The following guidelines define the appropriate use of conventional **Arrow** icons, **Chevrons**, and **Carets** in our design system. By following these basic pointers, we ensure a consistent user experience:

- Use **Arrows** for navigational transitions between different sections or pages and directional guidance.
- Use **Chevrons** for on-page interactions and indicating direction or progression within elements that offer generous space.
- Use **Carets** for compact on-page interactions and small navigational controls, such as indicating sorting or expandable content in lists and menus.

