Badge
Badges show notifications, counts, or status information.
- Useful links:
Use cases
Section titled “Use cases”Make sure the Badge is suitable for your use case. There may be other, more appropriate components available.
| Use case | Badge | Chip |
|---|---|---|
| Showing notifications, counts, or status information | ✅ | ❌ |
| Filtering content and triggering actions | ❌ | ✅ |
StrataKit MUI modifications
Section titled “StrataKit MUI modifications”- Added
typeprop. - Added
inlineprop. - The
"default"color has been removed. The default color is now"secondary".
Examples
Section titled “Examples”Use variant="dot" to display the badge without a count inside.
Inline
Section titled “Inline”Set the inline prop to display the badge in normal document flow instead of positioned relative to its child.
Colors
Section titled “Colors”- Secondary: The default.
- Info: Use to call out an object or action as having an important attribute.
- Success: Use to indicate a successful or completed state when it’s important to provide positive reinforcement.
- Warning: Use for warnings and time-sensitive issues that require attention and potential action.
- Error: Use for critical and irreversible issues that requires attention and potential action. Apply sparingly.
Use the type prop to adjust the visual prominence of an inline Badge.
- Strong: The default, use when you need the strongest emphasis.
- Muted: Use when you want a balanced level of emphasis.
- Outlined: Use when you need the least emphasis.
- Use Badge for indicating state or status.
- Include a concise and descriptive label.
- Use an
iconto communicate a statuscolorin a color-independent fashion.
🚫 Don’t
Section titled “🚫 Don’t”- Don’t make Badge interactive. It is for indicating status, not controlling it.
- Don’t override colors set using
colorprop. These have been chosen carefully for their contrast.