Skip to main content

Chip

The Chip component allows the user to select a value from a defined range. Either by using continuous Chip, stepped Chip or buffered Chip.

Import

// with @dhl-official/react-library:
import { DhlChip } from "@dhl-official/react-library"
// with @dhl-official/ui-libraries/react-library:
import { DhlChip } from "@dhl-official/ui-libraries/react-library"

Code

<DhlChip />

Interactive Demo

Example

<DhlChip 
variant="gray"
hasCancelIcon={true}
hasCheckIcon={true}>
Chip
</DhlChip>
Chip

Migrating from DUIL 1.0

  • Rename disabled to isDisabled

Readme

Properties

PropertyAttributeDescriptionTypeDefault
cancelLabelcancel-labelAn optional string to set aria-label on the cancelIconstring"Remove last item"
clickEvent--An optional onClick callback handler.(e: any) => voidundefined
dataTestiddata-testidAn optional prop. The test id attached to the component as a data-testid attribute.stringundefined
hasCancelIconhas-cancel-iconAn optional boolean to toggle the display of the cancel iconboolean \| stringfalse
hasCheckIconhas-check-iconAn optional boolean to toggle the display of the check iconboolean \| stringfalse
isButtonis-buttonAn optional boolean to set to false when it is used inline with no key/mouse actionbooleantrue
isDisabledis-disabledAn optional flag to define if the component is disabled.booleanfalse
valuevalueAn optional prop to uniquely identify the chip.stringundefined
variantvariantAn optional prop to select a component design variant."basic" \| "gray" \| "red"DHL_CHIP.VARIANT.BASIC

Events

EventDescriptionType
removeCustom event that gets emitted when the chip is removedCustomEvent<any>

Slots

SlotDescription
"unnamed"unnamed children slot for text that accompanies the DhlChip

Dependencies

Used by

Depends on

Graph


Built by DHL User Interface Library Team!