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 an
"inline"variant. - Added
sizeprop. - The
"default"and"primary"colors have 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 variant="inline" to display the badge in normal document flow instead of positioned relative to its child.
The size prop can only be set when using the "inline" variant.
- Small: Use in compact interfaces where space is limited.
- Medium: Default size, suitable for most use cases.
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" variant 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.