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.
Compact semantic markers, indicators and progress context.
Soft, solid, outline and default surface treatments are available; use clear labels rather than relying on color alone.
<div class="xsh-ref-flex"><span class="xsh-badge xsh-badge-solid" >Solid</span><span class="xsh-badge xsh-badge-soft" >Soft</span><span class="xsh-badge xsh-badge-outline" >Outline</span><span class="xsh-badge xsh-badge-solid" data-xsh-intent="primary" >Primary</span><span class="xsh-badge xsh-badge-success" >Success</span><span class="xsh-badge xsh-badge-info" >Info</span><span class="xsh-badge xsh-badge-warning" >Warning</span><span class="xsh-badge xsh-badge-danger" >Danger</span></div>Intent tokens can be composed with soft and solid treatments.
<div class="xsh-ref-flex"><span class="xsh-badge xsh-badge-soft" data-xsh-intent="primary">Primary</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="neutral">Neutral</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="success">Success</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="warning">Warning</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="danger">Danger</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="info">Info</span><span class="xsh-badge xsh-badge-soft" data-xsh-intent="brand">Brand</span></div>Tiny, standard and large badges with pill, square and dot styles.
<div class="xsh-ref-flex"><span class="xsh-badge xsh-badge-xs" >Compact</span><span class="xsh-badge" >Standard</span><span class="xsh-badge xsh-badge-lg" >Large</span><span class="xsh-badge xsh-badge-pill" >Pill</span><span class="xsh-badge xsh-badge-square" >Square</span><span class="xsh-badge xsh-badge-dot" >Online</span><span class="xsh-status" data-xsh-status="success">Operational</span><span class="xsh-status" data-xsh-status="warning">Attention</span></div>Use xsh-badge with a semantic variant, and xsh-status with data-xsh-status when a live state needs a colored dot.
<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>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.
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.
| Class | Purpose | Delivery |
|---|---|---|
.xsh-badge | Core component | CSS-only |
.xsh-badge-danger | Composable modifier / structure class | CSS-only |
.xsh-badge-dot | Composable modifier / structure class | CSS-only |
.xsh-badge-info | Composable modifier / structure class | CSS-only |
.xsh-badge-lg | Composable modifier / structure class | CSS-only |
.xsh-badge-outline | Composable modifier / structure class | CSS-only |
.xsh-badge-pill | Composable modifier / structure class | CSS-only |
.xsh-badge-soft | Composable modifier / structure class | CSS-only |
.xsh-badge-solid | Composable modifier / structure class | CSS-only |
.xsh-badge-square | Composable modifier / structure class | CSS-only |
.xsh-badge-success | Composable modifier / structure class | CSS-only |
.xsh-badge-warning | Composable modifier / structure class | CSS-only |
.xsh-badge-xs | Composable modifier / structure class | CSS-only |
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.
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.
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.
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.