Skip to main content

Tag

The Tag is a compact element that helps users quickly scan and identify categorized information. It is available in filled and outlined styles, in the neutral, positive, negative, warning, information and brand categories, and in sm and md sizes. An optional dot icon can be shown before the label with hasIcon.

The Tag is purely informative: it is not focusable and has no click behavior. Because the category is communicated by color, the label itself must describe the meaning (e.g. "Delivered" rather than relying on a green tag).

Import

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

Code​

<DhlTag tagStyle="filled" category="positive" size="md" textValue="Delivered" hasIcon></DhlTag>

Examples​

Filled​


Code example
<DhlTag category="neutral" textValue="Neutral" />
<DhlTag category="positive" textValue="Positive" />
<DhlTag category="negative" textValue="Negative" />
<DhlTag category="warning" textValue="Warning" />
<DhlTag category="information" textValue="Information" />
<DhlTag category="brand" textValue="Brand" />

Outlined, medium, with icon​


Code example
<DhlTag tagStyle="outlined" size="md" hasIcon category="neutral" textValue="Neutral" />
<DhlTag tagStyle="outlined" size="md" hasIcon category="positive" textValue="Positive" />
<DhlTag tagStyle="outlined" size="md" hasIcon category="negative" textValue="Negative" />
<DhlTag tagStyle="outlined" size="md" hasIcon category="warning" textValue="Warning" />
<DhlTag tagStyle="outlined" size="md" hasIcon category="information" textValue="Information" />
<DhlTag tagStyle="outlined" size="md" hasIcon category="brand" textValue="Brand" />

Interactive Demo​

Readme​

Properties​

PropertyAttributeDescriptionTypeDefault
categorycategoryAn optional prop to select the component category."brand" | "information" | "negative" | "neutral" | "positive" | "warning"DHL_TAG.CATEGORY.NEUTRAL
dataTestiddata-testidAn optional prop. The test id attached to the component as a data-testid attribute.stringundefined
hasIconhas-iconAn optional boolean prop to show a dot icon before the label.booleanfalse
sizesizeAn optional size prop for the component."md" | "sm"DHL_TAG.SIZE.SM
tagStyletag-styleAn optional prop to select the component style (filled or outlined)."filled" | "outlined"DHL_TAG.STYLE.FILLED
textValuetext-valueAn optional prop to set the component label.string"Tag label"

Built by DHL User Interface Library Team!