Accessibility
ARC UI targets WCAG 2.1 Level AA. Components render native elements where they exist, such as a real <button>, and set ARIA roles where they don't.
Automated audit
Every component page, live demos included, is checked withaxe-core against the rendered DOM, shadow roots included, in both themes. CI fails on any serious or critical violation, color contrast included, and no rules are switched off. Guide pages, the home page and the Theme Synthesizer aren't part of the audit.
ARIA attributes
Components set their own roles. arc-dialog renders a native<dialog> opened as a modal, and arc-tabs setstablist, tab and tabpanel. ARIA attributes you put on a host element mostly stay on the host. They don't reach the control inside the shadow root. arc-icon-button is the exception: it moves a host aria-label onto its inner button. arc-button doesn't forwardaria-label, and arc-input can't passaria-describedby into its shadow root, so the first two snippets below show what doesn't work. For an icon-only button, use arc-icon-buttonand give it a label. arc-input has no prop for a description.arc-alert announces errors and warnings assertively and success politely by default. Its live prop overrides that.
<!-- Labels -->
<arc-button aria-label="Close dialog">
<arc-icon name="x"></arc-icon>
</arc-button>
<!-- Descriptions -->
<arc-input
label="Password"
aria-describedby="pw-hint"
></arc-input>
<span id="pw-hint">Must be at least 8 characters</span>
<!-- Live regions -->
<arc-alert aria-live="polite" variant="success">
Changes saved successfully
</arc-alert>
Keyboard
These tabs are live. Tab to them and try the keys each one describes. The table below lists the keys for common components.
| Component | Keys | Action |
|---|---|---|
| Button | Enter / Space | Activate |
| Dialog | Escape | Close |
| Tabs | Arrow Left/Right, Home / End | Switch tab |
| Accordion | Enter / Space | Toggle panel |
| Select | Arrow Up/Down | Move between options |
| Select | Enter | Select option |
| Select | Escape | Close the list |
| Toggle | Space | Toggle on/off |
| Checkbox | Space | Toggle checked |
| Drawer | Escape | Close |
| Tooltip | Escape | Dismiss |
Focus
There are two focus indicator tokens. Tab through these to compare them.
Buttons and similar controls show focus on keyboard navigation (:focus-visible), not on a mouse click, so clicking the cards above shows nothing. Text fields show it on click as well. arc-dialog and a modalarc-drawer trap focus while open. A no-modal drawer doesn't, and opening one leaves focus where it was.
/* Customize focus styles globally */
:root {
--focus-ring: 0 0 0 2px var(--bg-deep),
0 0 0 4px var(--accent-primary);
--focus-glow: var(--focus-ring),
0 0 16px rgba(var(--accent-primary-rgb), 0.3);
}
Screen readers
ID references can't cross a shadow root, so a <label for> outside a component can't point at the field inside it.
- Slotted content stays in the light DOM, where screen readers reach it directly.
- Form controls take a
labelattribute, which the component ties to its inner field. Set it and the field is announced with its label.
<!-- Use slot for screen-reader-accessible content -->
<arc-card>
<h3>Account Settings</h3>
<p>Manage your profile and preferences.</p>
</arc-card>
<!-- Use label attribute for form elements -->
<arc-input label="Email address"></arc-input>
<arc-select label="Country">
<option value="us">United States</option>
<option value="uk">United Kingdom</option>
</arc-select>
Color contrast
The audit above measures rendered contrast in both themes. With the default tokens:
--text-primaryon--bg-deepis above 15:1 in the dark theme and above 13:1 in light.--text-mutedand--text-ghostmeet the 4.5:1 ratio for normal text in both themes.- The feedback colors (
--color-success,--color-warning,--color-error,--color-info) pass in both dark and light modes.
Reduced motion
With prefers-reduced-motion: reduce set, every transition and animation inside a component finishes almost instantly.
/* Built into ARC UI components */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}
Your own components get the same rule if they include tokenStyles. A collapsed animation runs once, immediately, and the element then shows itsun-animated styles, so a reduced-motion user sees whatever the base styles say. Put the resting state in the base styles and let the keyframes move away from it. A two-frame sprite that swaps layers by opacity shows both frames stacked if both are visible by default. Set opacity: 0 on the second frame in the base styles, as below, and a reduced-motion user sees only the first frame.
.frame-b { opacity: 0; } /* resting state: frame A only */
.frame-a { animation: swap-a 800ms steps(1) infinite; }
.frame-b { animation: swap-b 800ms steps(1) infinite; }
@keyframes swap-a { 50% { opacity: 0; } }
@keyframes swap-b { 50% { opacity: 1; } }
Without JavaScript
Web Components need JavaScript to upgrade. Until that happens (a failed script, a slow network, JS disabled), a custom element is an unknown tag rendering only its light DOM.
For links, an href on the custom element itselfcannot produce a working link without JavaScript. The attribute is on the element, and the real <a> only exists in a shadow root that never gets created. Slot a real anchor instead. It works as a link before the element upgrades.
<!-- Works without JS, and before the element upgrades -->
<arc-button variant="primary">
<a href="/get-started">Get started</a>
</arc-button>
<arc-navigation-menu>
<arc-nav-item><a href="/docs">Docs</a></arc-nav-item>
<arc-nav-item><a href="/pricing">Pricing</a></arc-nav-item>
</arc-navigation-menu>
<!-- Needs JS to become a link at all -->
<arc-button variant="primary" href="/get-started">Get started</arc-button>
On upgrade the component uses that anchor as its control and doesn't render a second one, so the accessibility tree has one link. The href form still works. Use it in app shells where JavaScript always runs, and use the slotted form on public pages. Slotted anchors work in arc-button,arc-icon-button, arc-link, arc-card,arc-nav-item, arc-breadcrumb-item, andarc-sidebar-link.
The stylesheet hides components until they upgrade, but only when scripting is available, so with JavaScript disabled your content stays visible.
/* Shipped in base.css */
@media (scripting: enabled) {
:is(arc-button, arc-link /* … */):not(:defined) { opacity: 0; }
}
Components that render their content from properties, such asarc-feature-card (heading and description), have no light DOM to fall back to and stay blank without JavaScript. Treat them as enhancement-only, or server-render them.
See also
- Server rendering: content in the HTML before JavaScript runs
- Getting started: installation and setup