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="selected-neutral" label="Chip" showCloseButton isSelected></DhlChip>

Migrating from DUIL 1.0

  • Rename disabled to isDisabled

Readme

Properties

PropertyAttributeDescriptionTypeDefault
clickEventclick-eventAn optional onClick callback handler.(e: any) => voidundefined
dataTestiddata-testidAn optional prop. The test id attached to the component as a data-testid attribute.stringundefined
isDisabledis-disabledAn optional flag to define if the component is disabled.booleanfalse
isSelectedis-selectedAn optional boolean to define if component is selected.booleanfalse
keyDownEventkey-down-eventAn optional onKeyDown callback handler.(event: KeyboardEvent) => voidundefined
labellabelAn optional prop to set component label.stringundefined
leftAssetSrcleft-asset-srcAn optional prop to define left asset src.stringundefined
leftAssetTypeleft-asset-typeAn optional prop to define left asset type."icon" | "image"DHL_CHIP.LEFT_ASSET_TYPE.ICON
showCloseButtonshow-close-buttonAn optional boolean to show the close button.booleantrue
showLeftAssetshow-left-assetAn optional boolean prop to show left asset.booleantrue
sizesizeAn optional size prop for the component."md" | "sm"DHL_CHIP.SIZE.MD
variantvariantAn optional prop to select a component color variant."selected-neutral" | "selected-positive" | "white"DHL_CHIP.VARIANT.WHITE

Dependencies

Used by

Depends on

Graph


Built by DHL User Interface Library Team!