Ghostcn
Skip to Content
ComponentsPrimitives

Badge

A small non-interactive label with variants and sizes.

Install

npx ghostcn@1.4.0 add badge --skip-existing

Usage

This badge is a label, not an interactive control. Use Button for an action or link.

{{> "components/badge" text="Featured"}}

Component options

ParameterBehavior
variantVisual treatment; unknown values fall back to default. Values: default, secondary, outline, destructive. Default: default.
sizeComponent scale; unknown values fall back to default. Values: sm, default, lg. Default: default.
textEscaped badge label. Default: Label.

Customize this instance

{{> "components/badge" text="Featured" class="rounded-full bg-purple-700 text-white"}}

Styling parameters

ParameterTarget
classComponent root — .ghcn-ui-badge

Styling parameters affect only elements that render. See Style component instances for specificity, dark mode, and preserving customizations.

Installed files

  • partials/components/badge.hbs
  • assets/css/components/badge.css

View the registry source

Edit this page on GitHub

Was this helpful?

On this page