Skip to Content

Chip

The Chip" component is a versatile UI element commonly used for displaying tags, labels, statuses, or categories. It’s highly customizable, enabling the use of different types, colors, sizes, and even adornments like icons. Chips can be interactive, allowing for selection or removal, making them suitable for various applications from filtering content to showing user selections.

Quick Start

To start using the Chip component, import it from the reablocks library.

Active

Examples

Basic Usage

The Chip component supports several style variants such as “filled” and “outline”. This allows for clear differentiation between different chip types based on their purpose or context within the UI:

Advanced Customization

Colors and Sizes

Chips can be customized further in terms of color and size, providing flexibility to match them with the application’s design theme:

Icon Adornment

Adding icons to chips enhances visual communication and can indicate additional functionalities like deletion or selection:

Selectable Chips

Chips can be made selectable, allowing users to choose one or more options from a set:

Blocks

This component is used in the following Blocks:

Theme Customization

The Chip component comes with a default theme, which can be customized according to your application’s design requirements:

  • root{}(9 keys)
      Show all

Learn more about how to customize in the Theme documentation.

API

Customize the Chip component using the following properties:

NameTypeDefault
colorstring

Color variant for the chip.

'default'
sizestring

Size variant for the chip.

'medium'
variantstring

Style variant for the chip.

'filled'
selectedboolean

Whether the chip is selected.

disabledboolean

Whether the chip is disabled.

disableMarginsboolean

Whether to disable the margins.

startstring | ReactElement<unknown, string | JSXElementConstructor<any>>

Content to display before the chip label.

endstring | ReactElement<unknown, string | JSXElementConstructor<any>>

Content to display after the chip label.

themeChipTheme

Theme for the Chip.

Design and Usability Tips

  • Dynamic Interaction: For chips representing dynamic content (like filters), provide immediate visual feedback when the state changes (e.g., through animation) to reflect the action’s impact.
  • Accessibility Enhancements: Beyond color, utilize shapes or icons within chips to communicate status or category for those with color vision deficiencies.
Last updated on