- Implementation
- Badge Props
Common Examples
Use relative positioning on badge parent
In order for a badge to properly position itself, the parent of theBadge component that the badge should be placed on needs to have position: relative.Adjusting badge position
When used with square or rectangular elements, the badge should position itself nicely on the corner of the element. Sometimes, some fine-tuning may be required if the element has a different shape, such as text. Use theoffset prop to supply CSS sizing values to the x and y parameters.Badges without children
If nochildren element is provided for the Badge component, only a red dot will appear.React Accessibility
Using aria-label
Do
Don’t