Badges are used to inform users of the status of an object or of an action that’s been taken.
<duet-badge variation="warning">Warning badge</duet-badge>
<duet-badge variation="danger">Danger badge</duet-badge>
<duet-badge variation="success">Success badge</duet-badge>
| || ||Controls the margin of the component.|| || |
| || ||Theme of the badge.|| || |
| || ||Style variation of the alert.|| || |
This section includes guidelines for designers and developers about the usage of this component in different contexts.
When to use #
- To give a status update on a piece of information or action.
- Marking something as “recommended” or “requiring attention.”
- When you want to highlight that an object has been recently added.
- When you want to highlight e.g. offers.
This section describes the different component variations, their purpose, and when to use each variation.
| ||Used to convey general information that isn’t critical. For example, you might show a status that tells that an item is “recommended.”|
| ||Used to convey success states. For example, you might show a success status to indicate that changes were saved or something was completed.|
| ||Used to communicate problems that have to be resolved so that user can continue forward. This variation should be always used for e.g. highlighting errors.|
| ||Used to display badges that needs user’s attention and may require further steps.|
This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.
- Badge is a normal div element with text inside which doesn’t have any added functionality for assistive technologies.
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Using CLI ToolsTutorials
Creating Custom PatternsTutorials
Server Side RenderingTutorials
Usage With Markdown
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.