Skip to content

Badge Component

Overview

The Badge component displays small inline labels for categorization, status indicators, or version tags. Badges are useful for drawing attention to metadata without interrupting the flow of content.

Badge is auto-imported in all MDX files, so you can use it without an import statement.

Basic Usage

<Badge text="New" />

You can also use Badge inline within a paragraph:

This feature is currently <Badge text="Beta" variant="caution" /> and may change in future releases.

Variants

The Badge component supports five color variants:

Default

<Badge text="Default" variant="default" />

A neutral gray badge suitable for general-purpose labels.

Info

<Badge text="Info" variant="info" />

A blue badge for informational labels such as version numbers or categories.

Tip

<Badge text="Tip" variant="tip" />

A green badge for positive indicators like “Stable”, “Recommended”, or “New”.

Caution

<Badge text="Caution" variant="caution" />

An amber badge for warning indicators like “Beta”, “Experimental”, or “Deprecated”.

Danger

<Badge text="Danger" variant="danger" />

A red badge for critical indicators like “Breaking Change”, “Removed”, or “Security”.

Sizes

Badges come in three sizes to accommodate different contexts:

Small

<Badge text="Small" size="sm" />

Best for inline use within body text or table cells.

Medium (Default)

<Badge text="Medium" size="md" />

The default size, suitable for most contexts including headings and labels.

Large

<Badge text="Large" size="lg" />

Best for standalone use or when extra emphasis is needed.

Props Reference

PropTypeDefaultDescription
textstringRequired. The text content displayed in the badge
variant"default" | "info" | "tip" | "caution" | "danger""default"The color variant of the badge
size"sm" | "md" | "lg""md"The size of the badge

Styling Details

Color Mapping

VariantBackground (Light)Text (Light)Background (Dark)Text (Dark)
defaultGray 100Gray 800Gray 800Gray 200
infoBlue 100Blue 800Blue 900Blue 200
tipGreen 100Green 800Green 900Green 200
cautionAmber 100Amber 800Amber 900Amber 200
dangerRed 100Red 800Red 900Red 200

Size Mapping

SizeFont SizePadding (x)Padding (y)Border Radius
sm0.7rem0.375rem0.125rem0.25rem
md0.75rem0.5rem0.125rem0.375rem
lg0.875rem0.625rem0.25rem0.375rem

Usage in Frontmatter

Badges can also be applied to sidebar labels through the page frontmatter:

---
title: "My Page"
section: "main"
sidebar:
  label: "My Page"
  badge:
    text: "New"
    variant: "tip"
---

This displays a badge next to the page title in the sidebar navigation.

Accessibility

  • Badges use display: inline-flex to align properly with surrounding text
  • Font weight is set to semi-bold for readability at small sizes
  • Color contrast ratios meet WCAG 2.1 AA requirements for all variant and mode combinations
  • Badges are purely decorative and do not convey information that is not also available in context

Best Practices

  • Use consistent variants — Establish a convention for which variant maps to which meaning (e.g., tip for “New”, caution for “Beta”) and apply it consistently across your documentation.
  • Keep text short — Badge text should be one or two words. Longer text should use an Aside or inline text instead.
  • Avoid overuse — A page with too many badges creates visual clutter. Reserve badges for genuinely useful status indicators.
  • Combine with context — Always ensure the badge meaning is clear from context. Do not rely on the badge color alone to convey meaning.
퍼널해커

중소기업을 위한 AI 마케팅&세일즈 자동화 시스템을 설계하고 구축합니다. 웹사이트, SEO, 콘텐츠, 리드 수집까지 한번에.

상호명: 퍼널해커 대표자: ___ 사업자등록번호: ___-__-_____ 통신판매업 신고번호: 제____-서울___-____호 주소: ___ 이메일: ___@funnelhacker.co.kr 호스팅 서비스 제공자: Netlify, Inc.

Copyright 2026 퍼널해커. All Rights Reserved