Skip to content

Accessibility (WCAG 2.1 AA)

WitTable is accessible by default — no special configuration required. The AriaManager applies WCAG 2.1 AA compliant attributes to the grid container and manages an aria-live="polite" region for dynamic announcements.

Live Demo
This table has built-in ARIA attributes: role=grid, aria-rowcount, aria-colcount. Use keyboard arrows to navigate; screen reader announces cell positions.
View source code
AccessibilityDemo.tsx
import { WitTable } from '@witqq/spreadsheet-react';
import { DemoWrapper } from './DemoWrapper';
import { generateEmployees, employeeColumns } from './generate-data';
import { useSiteTheme } from './useSiteTheme';
const data = generateEmployees(50);
export function AccessibilityDemo() {
const { witTheme } = useSiteTheme();
return (
<DemoWrapper title="Live Demo" description="This table has built-in ARIA attributes: role=grid, aria-rowcount, aria-colcount. Use keyboard arrows to navigate; screen reader announces cell positions." height={440}>
<WitTable
theme={witTheme}
columns={employeeColumns}
data={data}
showRowNumbers
aria-label="Employee directory"
style={{ width: '100%', height: '100%' }}
/>
</DemoWrapper>
);
}

The grid container receives these attributes automatically:

AttributeValuePurpose
rolegridIdentifies the component as a data grid
aria-rowcountTotal row countCommunicates full size (not just visible)
aria-colcountTotal column countCommunicates full size
aria-labelTable nameIdentifies the grid

AriaManager announces state changes to screen readers through the aria-live region:

  • Selection — “Cell B3 selected”, “Range A1 to C5 selected”
  • Sort — “Column Name sorted ascending”
  • Filter — “Column Status filtered, 42 rows visible”
  • Validation — “Cell B3: Email is required”
  • Edit — “Editing cell B3”, “Cell B3 updated”

No configuration needed. All accessibility features are built in:

import { WitTable } from '@witqq/spreadsheet-react';
function App() {
return (
<WitTable
columns={columns}
data={data}
aria-label="Employee directory"
/>
);
}

All features are accessible via keyboard:

ShortcutAction
Arrow keysNavigate cells
Enter / F2Start editing
EscapeCancel editing / close menu
TabMove to next cell
Ctrl+ASelect all
Ctrl+C / Ctrl+X / Ctrl+VCopy / Cut / Paste
Ctrl+Z / Ctrl+YUndo / Redo
MethodSignatureDescription
announce(message: string) => voidPush message to aria-live region
attach(container: HTMLElement) => voidAttach ARIA attributes to container
detach() => voidRemove ARIA attributes