- v2.14.0-stablePromoted across all production edgesRecommended
- v2.15.0-rc.2Canary validation in staging clusterPreview
- v2.13.4-ltsSecurity maintenance window ends Dec 31Deprecated
GhostBadge reference
Package: @ghostvue/themes. Status: experimental (stability policy).
Themed wrapper around headless GhostBadge. Same span semantics plus variant, tone, and size. Importing it loads the default stylesheet and scopes styles to this instance. Hand-written until GHO-13 generates manifests.
Generated from the component manifest. Edit the manifest or Vue source, then rebuild the docs.
Props
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
variant | 'solid' | 'soft' | 'outline' | 'ghost' | "soft" | No | Visual treatment. The default omits data-variant so CSS can treat a missing hook as soft. |
tone | 'accent' | 'neutral' | 'danger' | 'success' | 'warning' | "neutral" | No | Semantic color intent, independent of variant and not a status vocabulary. success and warning use the status tokens and are Badge-only; Button tones stay accent, neutral, and danger. The default omits data-tone. |
size | 'sm' | 'md' | "sm" | No | Compact type and padding. The default omits data-size so CSS can treat a missing hook as sm. Does not use control minimum sizes. |
Emits
None declared.
Models
None declared.
Slots
| Name | Description |
|---|---|
default | Short status or metadata text and optional decorative icon content. Icon-only use needs real hidden text (GhostVisuallyHidden), not aria-label on the span. |
Slot props: default
None declared.
Exposed members
| Name | Type | Description |
|---|---|---|
element | HTMLSpanElement | null | The native span after mount; null before mount and after unmount. Delegates to the unstyled GhostBadge. |
Parts and data attributes
| Attribute | Value | Description |
|---|---|---|
data-part | root | The native span inside the display:contents themed scope. |
data-part | icon | Optional decorative icon content inside the default slot. |
CSS variables
| Name | Description |
|---|---|
--ghost-surface-bg | Canvas background on .ghost-theme and the mix surface for soft, outline, and ghost treatments. |
--ghost-action-primary-bg | Solid background and outline/ghost foreground for the accent tone. |
--ghost-action-primary-fg | Content color on the solid accent treatment. |
--ghost-action-primary-border | Border color on the solid accent treatment. |
--ghost-action-neutral-bg | Solid background and outline/ghost foreground for the default neutral tone. |
--ghost-action-neutral-fg | Content color on the solid neutral treatment. |
--ghost-action-neutral-border | Border color on the solid and outline neutral treatments. |
--ghost-action-danger-bg | Solid background and outline/ghost foreground for the danger tone. |
--ghost-action-danger-fg | Content color on the solid danger treatment. |
--ghost-action-danger-border | Border color on the solid and outline danger treatments. |
--ghost-status-success-fg | Text color of the success tone, plus the fill of solid and the border of solid and outline success badges. |
--ghost-status-success-bg | Soft fill of the success tone and text color of solid success badges. |
--ghost-status-success-border | Border of the soft success tone. |
--ghost-status-warning-fg | Text color of the warning tone, plus the fill of solid and the border of solid and outline warning badges. |
--ghost-status-warning-bg | Soft fill of the warning tone and text color of solid warning badges. |
--ghost-status-warning-border | Border of the soft warning tone. |
--ghost-gradient-action-primary | Oklch gradient fill for solid accent badges. |
--ghost-gradient-action-neutral | Oklch gradient fill for solid neutral badges. |
--ghost-gradient-action-danger | Oklch gradient fill for solid danger badges. |
--ghost-state-mix-soft | Mix amount of the tone into the surface for the default soft treatment. |
--ghost-state-mix-border | Mix amount of the tone into the surface for the soft border. |
--ghost-radius-pill | Capsule corner radius of the themed badge. |
--ghost-type-size-xs | Font size for the default sm size. |
--ghost-type-size-sm | Font size for size md. |
--ghost-type-weight-medium | Badge label font weight. |
--ghost-space-gap-xs | Space between label and icon, and default block padding. |
--ghost-space-inset-xs | Default inline padding and md block padding. |
--ghost-space-inset-sm | Inline padding for size md. |
--ghost-action-icon-size | Size of content marked data-part=icon. |
--ghost-focus-ring-color | Outer color of the two-color keyboard focus indicator when a consumer supplies tabindex. |
--ghost-focus-ring-contrast | Inner color of the two-color keyboard focus indicator. |
Accessibility
Role: generic. APG pattern: https://www.w3.org/WAI/ARIA/apg/practices/names-and-descriptions/.
Required ARIA attributes: none.
Keyboard
| Key | Action | Automated browser test |
|---|---|---|
Tab | Does not land on the badge. The component is not a tab stop and adds no key handling. | Not reviewed |
Verification
Each category is reviewed separately. Automated keyboard and axe results do not attest manual or assistive-technology review.
| Category | Status | Evidence |
|---|---|---|
| Automated keyboard | Not reviewed | No declared key is mapped to a browser test yet. |
| Manual interaction | Not reviewed | No review recorded. |
| Assistive technology | Not reviewed | No review recorded. |
Examples
badge/release-channels
Badge variants and semantic tones marking release channel status inside a card.
badge/themed
Visual props on the @ghostvue/themes wrapper.
badge/icon
Optional decorative icon marked data-part=icon.
badge/table
Cell statuses, counts, and active-filter summaries.