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
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
isDisabledis-disabledAn optional flag to define if the component is disabled.booleanfalse
isSelectedis-selectedAn optional boolean to define if component is selected.booleanfalse
labellabelAn optional prop to set component lable.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
showCancelIconshow-cancel-iconAn optional boolean to show cancel icon.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.ColorVariants.gray \| ColorVariants.red \| ColorVariants.whiteDHL_CHIP.VARIANT.WHITE

Dependencies

Used by

Depends on

Graph


Built by DHL User Interface Library Team!