Chips are commonly used in filtering and as categorical identifiers. Chips can be contained within a Chip Group to provide keyboard functionality, consistent spacing, and facilitate selection workflows and filtering patterns.

Overview

Chips are small, feature-rich components that can be used independently or in groups. Chips are used in Combobox and other scenarios that have a filtering interaction.

Chips can be themed to convey a variety of information, can contain Icons, Avatars, or images as visual cues. Additionally, Chips can be closed and visually hidden by a user.

Sample

Usage

  • Labeling
  • Status badges
  • Contextual counts or context for information.

Accessibility

Keyboard navigation

KeyFunction
TabWhen closable is true, moves focus in and out of the "Close" button.
Tab and ShiftWhen closable is true, moves focus in and out of the "Close" button.
EnterWhen closable is true and focus is on the "Close" button, hides the component.
SpaceWhen closable is true and focus is on the "Close" button, hides the component.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
appearanceappearance

Specifies the appearance style of the component.

Extract<"outline" | "outline-fill" | "solid", Appearance>"solid"
closableclosable

When true, displays a close button in the component.

booleanfalse
closedclosed

When true, hides the component.

booleanfalse
closeOnDeleteclose-on-delete

When true, the component closes when the Delete or Backspace key is pressed while focused.

booleanfalse
disableddisabled

When true, interaction is prevented and the component is displayed with lower opacity.

booleanfalse
iconicon

Specifies an icon to display.

IconName
iconFlipRtlicon-flip-rtl

When true, the icon will be flipped when the element direction is right-to-left ("rtl").

booleanfalse
kindkind

Specifies the kind of the component, which will apply to border and background if applicable.

Extract<"brand" | "inverse" | "neutral", Kind>"neutral"
labelrequiredlabel

Specifies an accessible label for the component.

string
messageOverrides

Overrides individual strings used by the component.

Record<string, unknown> | undefined
scalescale

Specifies the size of the component.

When contained in a parent calcite-chip-group, inherits the parent's scale value.

Scale"m"
selectedselected

When true, the component is selected.

booleanfalse
valuevalue

The component's value.

any

Slots

NameDescription
default (unnamed)

A slot for adding text.

image

A slot for adding an image.

Styles

NameDescription
--calcite-chip-background-color

Specifies the component's background color.

--calcite-chip-border-color

Specifies the component's border color.

--calcite-chip-close-icon-color

Specifies the component's close element icon color.

--calcite-chip-corner-radius

Specifies the component's corner radius.

--calcite-chip-icon-color

Specifies the component's icon color.

--calcite-chip-select-icon-color-press

Specifies the component's selection element icon color when active.

--calcite-chip-select-icon-color-pressed
deprecated in v3.1.0, removal target v6.0.0 - Use --calcite-chip-select-icon-color-press instead. Specifies the component's selection element icon color when active.
--calcite-chip-select-icon-color

Specifies the component's selection element icon color.

--calcite-chip-text-color

Specifies the component's text color.

Events

NameDescriptionBehavior
calciteChipClose

Fires when the component's close button is selected.

bubblescomposed
calciteChipSelect

Fires when the selected state of the component changes.

bubblescomposed

Methods

NameDescriptionSignature
componentOnReady

Creates a promise that resolves once the component is fully loaded.

componentOnReady(): Promise<this>
setFocus

Sets focus on the component.

setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.