KPI and metric systems
Consistent typography, status indicators and semantic labels make metrics legible in dashboards and reports.
Metric and commercial compositions
Use native semantic headings and descriptions inside a reusable Xshna card.
Advanced tools and dedicated workspaces.
<div class="xsh-ref-card-grid"><article class="xsh-card"><span class="xsh-stat-label">Active members</span><div class="xsh-stat-value">18,240</div><span class="xsh-badge xsh-badge-success">+8.2%</span></article><article class="xsh-card xsh-card-feature"><span class="xsh-stat-label">Enterprise</span><div class="xsh-pricing-price">$49<span>/month</span></div><p>Advanced tools and dedicated workspaces.</p><button type="button" class="xsh-btn xsh-btn-primary" >Choose plan</button></article></div>Live component example
The following semantic HTML uses shipped class names. Interactive application behavior, when required, is provided by the optional JavaScript layer or your application.
Total sessions
124,982+9%Copyable HTML
<div class="xsh-app xsh-card"><p>Total sessions</p><strong class="xsh-kpi-value">124,982</strong><span class="xsh-badge xsh-badge-soft" data-xsh-intent="success">+9%</span></div>Installation and dependencies
Place dist/xshna.min.css in your site's assets directory. For declarative interactive components, also load dist/xshna.min.js with defer. Individual icon assets are available as SVG files in dist/icons/svg/. Copy the files you use, or deploy the complete icon directory. No Node.js is required on the hosting server.
Public selectors and related configuration
Relevant names or configuration points for this pattern are documented below. Names are composable; not every combination implies a distinct behavior.
| Selector, attribute or file | Role |
|---|---|
xsh-kpi-value | Configuration or reusable building block |
xsh-card | Configuration or reusable building block |
xsh-badge | Configuration or reusable building block |
Composition, states and responsive behavior
Prefer intrinsic sizing, grid or flexible wrapping. Test minimum viewport widths of 320px, 375px and 768px, and narrow component containers. Long labels must wrap or be truncated intentionally without making essential content unavailable.
For stateful controls, apply the correct native disabled, required, checked or aria attributes. States must be conveyed in text or accessible names, rather than by color alone. Avoid nesting interactive elements inside interactive controls.
Keyboard and screen-reader contract
Use the native semantic HTML element first: a button for an action, a link for navigation, a label associated with each input and a real table for tabular data. Keyboard interaction should preserve visible focus and predictable Tab order. Inspect the rendered UI with actual assistive technology before certifying accessibility.
Themes, density, RTL and motion
Apply data-xsh-theme for light/dark/high-contrast themes, data-xsh-design for a Design DNA personality and data-xsh-density for comfortable or dense presentations. Prefer logical properties so the pattern works when the document direction changes.
Respect prefers-reduced-motion and provide a static presentation for content that would otherwise depend on animation. A personality is a coordinated visual preset, not a guarantee that arbitrary custom colors satisfy WCAG contrast requirements.
Performance and source ownership
This pattern is built from static classes. Use Xshna Extract for application-specific CSS reduction, or ship the complete distribution when simplicity matters more than transfer size. Application data, authentication and persistence remain the responsibility of your application.
Common problems and troubleshooting
If styles are missing, confirm that the CSS URL resolves and the root has class="xsh-app". For missing icons, verify that the self-hosted SVG files exist under dist/icons/svg/ and that image paths resolve correctly. If a dynamic class disappears after extraction, add the class to the Extract safelist and regenerate the bundle.
Version and limitations
This reference applies to Xshna.css 1.0.0-beta.2. Beta APIs may change. See the accompanying release notes and test report for verified browser coverage and known limitations.
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.
| Class | Purpose | Delivery |
|---|---|---|
.xsh-kpi | Core component | CSS-only |
.xsh-kpi-value | Composable modifier / structure class | CSS-only |
Implementation details
Semantic structure
Use the documented Xshna classes with semantic HTML rather than replacing native elements unnecessarily.
Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.
Interactive behavior
Verify focus order, disabled behavior and descriptive labels for interactive patterns.
Load xshna.min.js only if the documented interaction needs it. Your application remains responsible for data, persistence and business rules.
Responsive and localization
Test narrow containers, long translations and user-defined text sizes.
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.
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.