Skip to content

InfoChip

An InfoChip is a non-interactive indicator that provides information and/or conveys a status.

Info Chip
NameValue
Props
icon
status
Slots
default
View
Reading direction
Note: For icon properties, the relevant icon also needs to be imported from the @wikimedia/codex-icons package. See the usage documentation for more information.

Overview

When to use InfoChip

Use the InfoChip component to label, categorize, or organize information using keywords. This type of chip is just informative so it cannot be clickable or removable.

Depending on the type of feedback conveyed to the user, InfoChips can be used to convey one of four statuses.

  1. Notice
    Use to convey a general, neutral, and non-urgent status.
  2. Warning
    Use to convey a cautionary status.
  3. Error
    Use to convey a negative status.
  4. Success
    Use to convey a positive status.

About InfoChip

InfoChip includes the following elements.

Icon (optional)

For notice chips, the icon is optional and customizable, while for chips providing feedback (warning, error, and success), the icon is required to communicate the feedback status effectively.

  • Use a start icon in notice chips when needed to strengthen the text, or hide it if not required.
  • Avoid removing or replacing the icon in warning, error, and success chips, as it reinforces the meaning of their respective statuses.

Label

Descriptive text about the chip.

  • Use short text with the InfoChip. Long text content will be truncated with an ellipsis and lines will not be wrapped.

Examples

With icon

For notice chips, the icon can be customized.

Photos

Developer notes

Custom icons can only be used with the notice status. If they are passed with a different status, they will be ignored.

Statuses

Use the status prop to create warning, error, and success InfoChips.

1 test has not run
2 tests are failing
All tests are passing

Technical implementation

Vue usage

Props

Prop nameDescriptionTypeValuesDefault
statusStatus type.StatusType'notice', 'warning', 'error', 'success''notice'
iconCustom icon to use for "notice" chips. Chips with other status types (warning, etc) do not allow custom icons and will ignore this option.Icon-null

Slots

NameDescriptionBindings
defaultChip content.

CSS-only version

Markup structure

Text only

A simple chip with text content and no icon is straightforward.

Info Chip

Status types

There are four status types, "notice", "warning", "error", and "success".

Apply the following classes to the root element to define the status styles:

  • Notice: cdx-info-chip--notice (class can be omitted since this is the default)
  • Warning: cdx-info-chip--warning
  • Error: cdx-info-chip--error
  • Success: cdx-info-chip--success

Status icons

Each status has a corresponding default icon (cdxIconInfoFilled for "notice" status, cdxIconAlert for "warning" status, cdxIconError for "error" status, and cdxIconSuccess for "success" status). Examples of the default icons can be found below.

To use the default icon for a given chip status, simply include an empty <span> element with the class cdx-info-chip__icon inside the chip element.

Notice
Warning
Error
Success

Custom icons

You can customize the icon by using the CSS-only Icon Less mixin (.cdx-mixin-css-icon) to apply the icon styles, passing the appropriate parameters to the mixin.

Custom icons should only be used with "notice" status InfoChips.

Notice
Photos
Users
Articles