Go Main page
Go Main page

Web components

cover

components

Badge

v.1.0.0 | Saturn

Import

import { Badge } from '@kubit-ui-web/react-components'
123456789
<Badge
  variant="PRIMARY"
  size="DEFAULT"
  dot={{ variant: 'WITH_BORDER', size: 'MEDIUM', number: 8, maxNumber: 9 }}
  popover={{ variant: 'BADGE', content: 'Popover content' }}
  icon={{ icon: 'ICON_PLACEHOLDER' }}
  labelIcon={{ icon: 'ICON_CHEVRON_DOWN' }}
  label={{ content: 'Notifications' }}
/>

Props

Let's delve into the versatility of the confirmationMessage component by examining all its avalaible props.

Uncontrolled

PropertyTypeDefaultDescription
variant
Required
String-Current variant of Badge
size
Required
String-Current size of Badge
icon
Required
IElementOrIcon-Main icon.
popover
Required
BadgePopoverType-Properties of Popover component.
dotIDot-Properties of Dot component.
hasDotBooleantrueIt shows or hides the dot.
labelBadgeLabelType-Label showed below the icon.
labelIconIElementOrIcon-Icon showed with the label.
ariaLiveTextString-Text that will be read by ScreenReader
aria-labelstring-aria-label of the Badge
customDotTranslatestring-Value applied to the css 'transform' prop of the Dot
dataTestIdString-Id for testing
ctvConfirmationMessagePropsStateStylesType-Modify styles for the default version of the component
onClickReact.MouseEventHandler-OnClick callback applied to Badge

Controlled

PropertyTypeDefaultDescription
variant
Required
String-Current variant of Badge
size
Required
String-Current size of Badge
icon
Required
IElementOrIcon-Main icon.
popover
Required
BadgePopoverType-Properties of Popover component.
onClick
Required
React.MouseEventHandler-OnClick function applied to Badge
onBadgeBlur
Required
React.FocusEventHandler-OnBlur function applied to Badge
open
Required
Boolean-It indicates if Badge is open or closed
dotIDot-Properties of Dot component.
hasDotBooleantrueIt shows or hides the dot.
labelBadgeLabelType-Label showed below the icon.
labelIconIElementOrIcon-Icon showed with the label.
ariaLiveTextString-Text that will be read by ScreenReader
aria-labelstring-aria-label of the Badge
customDotTranslatestring-Value applied to the css 'transform' prop of the Dot
dataTestIdString-Id for testing
ctvConfirmationMessagePropsStateStylesType-Modify styles for the default version of the component