# Badge

Similar to a Button, the Badge component uses the same syntax as a hyperlink, but is prefixed with a !badge identifier.


Normal link

[!badge Badge](badge.md)

[Normal link](badge.md)

With the Badge component, the destination is optional and can be ommitted.


[!badge Badge]

# Variants

[!badge variant="primary" text="Primary"]
Variant Example
primary (default) Primary
secondary Secondary
success Success
danger Danger
warning Warning
info Info
light Light
dark Dark
contrast Contrast

# Corners

[!badge text="Default"]
[!badge corners="square" text="Square"]
[!badge corners="pill" text="Button Pill"]
Size Example
round (default) Default
square Square
pill Button Pill

# Size

[!badge size="m" text="Medium"]
Size Example
xs XSmall
s Small
m (default) Medium
l Large
xl XLarge
2xl 2XLarge
3xl 3XLarge

# Icon and Emoji

# Octicons

Octicons can be used as an icon by settiing the icon property with the name of the Octicon.

[!badge variant="info" icon="person" text="User" margin="0 8 0 0"]
[!badge variant="primary" icon="paper-airplane" iconAlign="right" text="Send"]

User Send

# Emoji

Emoji :shortcodes: can be used for the icon. Please see Mojee for a full list of supported Emoji shortcodes.

[!badge variant="light" icon=":heart:" text="Like"]
[!badge variant="info" icon=":rocket:" iconAlign="right" text="Rocket"]

❤️ Like Rocket 🚀

# Image file

Any image file can be used as the icon.

[!badge icon="../static/retype-logo.svg"]

# SVG image

The icon can also be set with an inline <svg> element.

[!badge icon="<svg width=&quot;24&quot; height=&quot;24&quot;><path fill-rule=&quot;evenodd&quot; d=&quot;M12 16.5a4.5 4.5 0 100-9 4.5 4.5 0 000 9zm0 1.5a6 6 0 100-12 6 6 0 000 12z&quot;></path></svg>" text="Visit website"](badge.md)

Visit website