BadgePrimitive

A basic type that allows you to choose colors to fit any need.

To implement BadgePrimitive component into your project you’ll need to add the import:

import BadgePrimitive from "@kiwicom/orbit-components/lib/primitives/BadgePrimitive";

After adding import into your project you can use it simply like:

<BadgePrimitive>Hello!</BadgePrimitive>

Table below contains all types of the props available in BadgePrimitive component.

NameTypeDefaultDescription
backgroundstringBackground of a BadgePrimitive. Can use gradients and images
borderColorstringColor of the border that is always solid and one pixel.
foregroundColorstringForeground color, controling color of a text and icon.
childrenReact.NodeThe content of the BadgePrimitive.
dataTeststringOptional prop for testing purposes.
iconReact.NodeThe displayed icon on the left.
ariaLabelstringAdds prop adds aria-label to an element, useful for screenreaders.