Skip to content
Xshna.cssv1.0.0-beta.2
PlaygroundUtilities
DOCUMENTATION / COMPONENTS
Components / Component reference

Badges and status

Compact semantic markers, indicators and progress context.

V1 BETA / DOCUMENTEDLive variants · API · Accessibility · Responsive guidance

Overview

Use xsh-badge with a semantic variant, and xsh-status with data-xsh-status when a live state needs a colored dot.

Live example

Interactive · Real framework
New Draft Operational Attention

Example markup

<div class="xsh-flex xsh-flex-wrap xsh-gap-3">
 <span class="xsh-badge xsh-badge-solid" data-xsh-intent="primary">New</span>
 <span class="xsh-badge">Draft</span>
 <span class="xsh-status" data-xsh-status="success">Operational</span>
 <span class="xsh-status" data-xsh-status="warning">Attention</span>
</div>

Production guidance

Never convey status exclusively by color; include readable labels.

Customize this component through --xsh-* CSS tokens, data-xsh-* configuration attributes and documented xsh-* utilities. Use the optional JavaScript distribution only when an interactive behavior is needed.

EXACT NAMES FROM THE SHIPPED STYLESHEETS

Complete selector inventory

These selectors exist in the current distribution. An entry in this table does not imply that arbitrary modifier combinations are meaningful; use the examples above for the intended composition.

ClassPurposeDelivery
.xsh-badgeCore componentCSS-only
.xsh-badge-dangerComposable modifier / structure classCSS-only
.xsh-badge-dotComposable modifier / structure classCSS-only
.xsh-badge-infoComposable modifier / structure classCSS-only
.xsh-badge-lgComposable modifier / structure classCSS-only
.xsh-badge-outlineComposable modifier / structure classCSS-only
.xsh-badge-pillComposable modifier / structure classCSS-only
.xsh-badge-softComposable modifier / structure classCSS-only
.xsh-badge-solidComposable modifier / structure classCSS-only
.xsh-badge-squareComposable modifier / structure classCSS-only
.xsh-badge-successComposable modifier / structure classCSS-only
.xsh-badge-warningComposable modifier / structure classCSS-only
.xsh-badge-xsComposable modifier / structure classCSS-only
ENGINEERING AND INTEGRATION

Implementation details

Semantic structure

Badges communicate status but should not be the only signal.

Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.

Interactive behavior

Announce changing status with a suitable live region outside the badge.

Load xshna.min.js only if the documented interaction needs it. Your application remains responsible for data, persistence and business rules.

Responsive and localization

Avoid inserting interactive controls inside an inline noninteractive badge.

Test 320px-wide viewports, container-constrained instances, keyboard zoom, longer translations and right-to-left text where relevant.

Theme and customization

Use --xsh-* CSS variables for theme values and data-xsh-design / data-xsh-density on the xsh-app root.

Prefer design tokens over hard-coded overrides so components remain coherent across personalities.

ACCEPTANCE CHECKLIST

What to verify before shipping

  • Confirm every documented class used by the feature exists in the release CSS.
  • Navigate controls using Tab, Shift+Tab, Enter, Space and Escape where appropriate.
  • Test with reduced motion, high contrast, 200% text zoom and a narrow mobile viewport.
  • Verify disabled, loading, empty, error and long-content states where relevant.
  • Check actual application behavior independently of the preview: these examples use illustrative data.