Badge API
Import
Section titled “Import”import { Badge } from '@cimpress-ui/react';API reference
Section titled “API reference”Displays a small piece of information, such as a status or a category.
- Ref<HTMLDivElement>
The
reftype for this component.
BadgeProps
- StringLikeChildren
children *
Section titled “children * ” The content to display as the label.
- 'success' | 'base' | 'info' | 'warning' | 'critical' | 'brown' | 'indigo' | 'lime' | 'pink' | 'purple' | 'emerald'
- Defaults to 'base' .
Determines the color tone of the badge.
- 'small' | 'medium' | 'large'
- Defaults to 'medium' .
The size of the badge.
- ReactNode
iconStart
Section titled “iconStart” The icon to display at the start of the badge.
Should not be used when size is set to
'small'as icons won't be displayed at this size.- string
The element's unique identifier. See MDN.
- boolean
data-cim-style-root
Section titled “data-cim-style-root” Use this attribute to "claim" the component tree for exclusive Cimpress UI usage.
- string
UNSAFE_className
Section titled “UNSAFE_className” Sets the CSS className for the element. Only use as a last resort. Use style props instead.
See styling guide.
- CSSProperties
UNSAFE_style
Section titled “UNSAFE_style” Sets the CSS style for the element. Only use as a last resort. Use style props instead.
See styling guide.
StyleProps
- Responsive<Spacing | "auto">
margin
Section titled “margin” The amount of margin applied to all edges of this component.
- Responsive<Spacing | "auto">
marginX
Section titled “marginX” The amount of margin applied to the left and right edges of this component. Takes priority over
margin.- Responsive<Spacing | "auto">
marginY
Section titled “marginY” The amount of margin applied to the top and bottom edges of this component. Takes priority over
margin.- Responsive<Spacing | "auto">
marginTop
Section titled “marginTop” The amount of margin applied to the top edge of this component. Takes priority over
marginYandmargin.- Responsive<Spacing | "auto">
marginRight
Section titled “marginRight” The amount of margin applied to the right edge of this component. Takes priority over
marginXandmargin.- Responsive<Spacing | "auto">
marginBottom
Section titled “marginBottom” The amount of margin applied to the bottom edge of this component. Takes priority over
marginYandmargin.- Responsive<Spacing | "auto">
marginLeft
Section titled “marginLeft” The amount of margin applied to the left edge of this component. Takes priority over
marginXandmargin.