The Badge component is an inline element used to highlight status, labels, or categories within text content.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/devscribe-team/webeditor/llms.txt
Use this file to discover all available pages before exploring further.
Node specification
The badge is an inline, atomic node that cannot contain other content.The visual style variant. Available options:
default, secondary, destructive, outlineThe text content displayed in the badge
Usage
Insert via command menu
Type/badge in the editor and select the Badge option from the command menu. The badge will be inserted with default styling that you can customize.
Insert via input rule
Type<badge followed by optional attributes:
Programmatic insertion
Use theinsertBadge function to insert a badge programmatically:
Attributes
The badge node spec defines the following attributes:Variants
The badge supports four visual variants:Primary color scheme with
bg-primary and text-primary-foregroundSecondary color scheme with
bg-secondary and text-secondary-foregroundRed destructive color scheme with
bg-destructive and text-whiteOutlined style with border and transparent background
Editing
In edit mode, click the badge to open the badge edit modal where you can:- Edit label: Change the badge text
- Select variant: Choose from the four available styles with live preview
The badge edit modal provides a visual preview of each variant style, making it easy to choose the right look for your content.
Styling
ThebadgeClassName utility function generates the appropriate Tailwind classes based on the variant: