Skip to content
Xshna.cssv1.0.0-beta.2
PlaygroundUtilities
DOCUMENTATION / INTERACTIONS
Interactions / Component reference

Command palette

Keyboard-launchable command surface using native dialog.

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

Overview

Create a dialog.xsh-command with a xsh-command-input and xsh-command-result links. Press Ctrl+K or Cmd+K to open it. The command input locally filters registered results.

Live example

Interactive · Real framework

Example markup

<button class="xsh-btn xsh-btn-primary" data-xsh-open="#xsh-command-demo">Open command palette · Ctrl K</button>
<dialog class="xsh-command" id="xsh-command-demo" aria-label="Search commands"><label class="xsh-sr-only" for="xsh-command-search">Find a command</label><input class="xsh-command-input" id="xsh-command-search" placeholder="Type to find a command..."><div class="xsh-stack xsh-p-3"><a class="xsh-command-result" href="#">Create new project</a><a class="xsh-command-result" href="#">Open workspace</a><a class="xsh-command-result" href="#">Edit preferences</a></div><button class="xsh-btn xsh-btn-ghost" data-xsh-close>Close</button></dialog>

Production guidance

The palette does not index external data or execute commands; application-specific actions must be wired explicitly.

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.

REFERENCE CONTRACT

Files, tokens and configuration

SurfaceSource of truthWhat to check
dist/xshna.min.cssCompiled frameworkStyling and responsive behavior
dist/xshna.min.jsOptional interactionsLifecycle, event handling and teardown
src/css/Readable sourcePublic class names and token definitions
src/contracts/Published component contracts where availableState, configuration and behavioral support
ENGINEERING AND INTEGRATION

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.

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.