A11y

From rogie/figui3 · View interactive version

A11y is an AI agent skill from the GitHub repository rogie/figui3. Guides accessibility review and implementation for FigUI3 web components and playground examples. Use when the user mentions accessibility, a11y, ARIA, screen readers, keyboard navigation, focus rings, labels, roles, disabled states, contrast, dialogs, menus, or form control semantics.

How to use this skill

Skill file

Accessibility

Use this skill when adding, reviewing, or debugging accessibility behavior in FigUI3.

Core Principles

  1. Preserve native semantics first. Use native controls, form labels, button, input, dialog, and real focus behavior where possible.
  2. Add ARIA only to complete semantics, not to replace correct markup.
  3. Keyboard support is required for every interactive component.
  4. Disabled and readonly states must affect behavior, focusability, ARIA, visuals, and emitted events consistently.
  5. Focus indicators must be visible, token-based, and match existing FigUI3 patterns.
  6. Custom elements must keep semantics stable across light/dark themes and React usage.

Implementation Checklist

FigUI3 Patterns

Disabled custom elements

For non-native interactive custom elements:

const disabled =
  this.hasAttribute("disabled") && this.getAttribute("disabled") !== "false";

if (disabled) {
  this.setAttribute("aria-disabled", "true");
  this.setAttribute("tabindex", "-1");
} else {
  this.removeAttribute("aria-disabled");
  this.setAttribute("tabindex", "0");
}

If a component uses roving tabindex, keep inactive and disabled items at tabindex="-1".

Focus rings

Prefer existing token patterns:

&:focus-visible,
&[data-focus-visible] {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
}

If focus lands on a hidden native input, apply the ring to the visible host surface:

fig-button:has(> input:focus-visible) {
  outline: 0;
  box-shadow: inset 0 0 0 1px var(--figma-color-border-selected);
}

Menus

Dialogs and popups

Review Output

When reviewing a11y work, lead with concrete issues:

Include the component and file path for each finding.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.