Semantic structure
Labels must be programmatically associated with form controls.
Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.
Inputs, selectors, textareas, floating labels, input groups, switches, ranges and field help.
Real native controls retain platform keyboard, selection, validation and autofill behavior. Every control should have an associated label.
<div class="xsh-ref-formgrid"><label class="xsh-field"><span class="xsh-label">Text field</span><input class="xsh-input" type="text" placeholder="Text field" ></label><label class="xsh-field"><span class="xsh-label">Email address</span><input class="xsh-input" type="email" placeholder="Email address" autocomplete="email"></label><label class="xsh-field"><span class="xsh-label">Password</span><input class="xsh-input" type="password" placeholder="Password" autocomplete="new-password"></label><label class="xsh-field"><span class="xsh-label">Search</span><input class="xsh-input" type="search" placeholder="Search" ></label><label class="xsh-field"><span class="xsh-label">Disabled field</span><input class="xsh-input" type="text" placeholder="Disabled field" disabled></label><label class="xsh-field"><span class="xsh-label">Choose a plan</span><select class="xsh-select"><option>Starter</option><option>Enterprise</option></select></label><label class="xsh-field"><span class="xsh-label">Message</span><textarea class="xsh-textarea" rows="3" placeholder="Write a message"></textarea></label></div>Native checkbox, radio, range, progress and toggle primitives with accessible names.
<div class="xsh-ref-flex"><label><input class="xsh-checkbox" type="checkbox" checked> Email updates</label><label><input class="xsh-radio" type="radio" name="xsh-doc-plan" checked> Monthly</label><label><input class="xsh-radio" type="radio" name="xsh-doc-plan"> Yearly</label><label class="xsh-switch"><input type="checkbox" checked><span>Alerts enabled</span></label><label>Range <input type="range" class="xsh-range" min="0" max="100" value="65"></label></div>Use native inputs with visible labels and xsh-input/xsh-select/xsh-textarea. Use explicit IDs for label associations.
<form class="xsh-stack" onsubmit="return false">
<div class="xsh-field"><label class="xsh-label" for="xsh-form-email">Work email</label><input class="xsh-input" id="xsh-form-email" type="email" placeholder="[email protected]"></div>
<div class="xsh-field"><label class="xsh-label" for="xsh-form-role">Role</label><select class="xsh-select" id="xsh-form-role"><option>Developer</option><option>Designer</option><option>Product manager</option></select></div>
<label class="xsh-switch"><input type="checkbox"><span>Receive updates</span></label>
<button class="xsh-btn xsh-btn-primary" type="submit">Continue</button>
</form>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-form-error | Composable modifier / structure class | CSS-only |
Labels must be programmatically associated with form controls.
Compose existing xsh- classes on the appropriate HTML element. Keep content order meaningful when CSS is disabled.
Browser validation does not replace server validation. Use aria-describedby for error text.
Load xshna.min.js only if the documented interaction needs it. Your application remains responsible for data, persistence and business rules.
Never use placeholder text as the only field label.
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.