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

Cards

Flat, elevated, statistical and media cards that integrate with layout and DNA systems.

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

Overview

Compose cards using xsh-card, optional data-xsh-elevation, and xsh-card-header, xsh-card-footer or xsh-stat.

Live example

Interactive · Real framework

Revenue

Live

₹84,560

This month

Visitors

12,480

+12.4%

Example markup

<div class="xsh-grid xsh-grid-cols-1 xsh-md-grid-cols-2 xsh-gap-4">
 <article class="xsh-card" data-xsh-elevation="raised"><div class="xsh-card-header"><h3 class="xsh-h3">Revenue</h3><span class="xsh-badge">Live</span></div><p class="xsh-stat-value">₹84,560</p><p class="xsh-muted">This month</p></article>
 <article class="xsh-stat"><p class="xsh-stat-label">Visitors</p><strong class="xsh-stat-value">12,480</strong><p class="xsh-stat-trend">+12.4%</p></article>
</div>

Production guidance

Cards should not become clickable unless a link or button provides keyboard-accessible navigation.

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-cardCore componentCSS-only
.xsh-card-borderlessComposable modifier / structure classCSS-only
.xsh-card-featureComposable modifier / structure classCSS-only
.xsh-card-footerComposable modifier / structure classCSS-only
.xsh-card-glassComposable modifier / structure classCSS-only
.xsh-card-headerComposable modifier / structure classCSS-only
.xsh-card-insetComposable modifier / structure classCSS-only
.xsh-card-interactiveComposable modifier / structure classCSS-only
.xsh-card-titleComposable modifier / structure classCSS-only
ENGINEERING AND INTEGRATION

Implementation details

Semantic structure

A card is a container, not automatically a link.

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

Interactive behavior

If the full card is interactive, ensure a single coherent focus target.

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 nesting actionable elements inside a wrapping button or anchor.

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.