Back to Uno

Automation peers

doc/articles/features/accessibility/automation-peers.md

6.6-release-branch-cut4.1 KB
Original Source

Automation peers

[!TIP] This article covers Uno-specific details about how automation peers work on Skia targets. For a full description of the peer model and how to create custom peers, see Custom automation peers (Microsoft Learn).

Every XAML control exposes its accessibility information through an automation peer. Uno implements the same AutomationPeer model as WinUI — when you use standard controls, the correct peer is created automatically.

Built-in peers and ARIA role mapping

On WASM, the ARIA role is derived from the AutomationControlType reported by the peer. The full mapping is defined in the AriaMapper class.

ControlAutomation PeerARIA Role (WASM)
ButtonButtonAutomationPeerbutton
CheckBoxCheckBoxAutomationPeercheckbox
RadioButtonRadioButtonAutomationPeerradio
SliderSliderAutomationPeerslider
TextBoxTextBoxAutomationPeertextbox
PasswordBoxPasswordBoxAutomationPeertextbox (password)
ComboBoxComboBoxAutomationPeercombobox
ToggleSwitchToggleSwitchAutomationPeerbutton (with aria-pressed)
ToggleButtonToggleButtonAutomationPeerbutton (with aria-pressed)
ListViewListViewAutomationPeerlistbox
ListViewItemListViewItemAutomationPeeroption
HyperlinkButtonHyperlinkButtonAutomationPeerlink
ImageImageAutomationPeerimg
ProgressBarProgressBarAutomationPeerprogressbar
TextBlockTextBlockAutomationPeer(none — text role)

Supported automation patterns

Automation patterns define the interaction capabilities of a control. All patterns below are routed through the Skia accessibility layer to each platform's native API.

PatternInterfaceUsed For
InvokeIInvokeProviderSingle-action controls (buttons, links)
ToggleIToggleProviderTwo-state controls (checkboxes, toggle buttons)
RangeValueIRangeValueProviderControls with a numeric range (sliders)
ValueIValueProviderControls with a text value (text boxes)
ExpandCollapseIExpandCollapseProviderExpandable controls (combo boxes, tree items)
SelectionISelectionProviderContainers that manage selected items (lists)
SelectionItemISelectionItemProviderIndividual selectable items
ScrollIScrollProviderScrollable content areas
ScrollItemIScrollItemProviderItems that can be scrolled into view
GridIGridProviderGrid layouts
GridItemIGridItemProviderItems within a grid
TableITableProviderTable structures

Skia accessibility architecture

On all Skia targets (Win32, macOS, WASM, Android), the accessibility tree is built from automation peers. A shared base layer (SkiaAccessibilityBase):

  • Queries each peer for its name, role, states, and patterns
  • Routes property changes and focus events to the platform-specific implementation

Each platform applies its own pruning strategy. For example, WASM prunes structural elements (like Grid, Border, ContentPresenter) that have no accessible information, to keep the semantic DOM compact. macOS adds all elements but uses NSAccessibilityUnknownRole for those without meaningful roles so VoiceOver skips them.

Platform-specific behavior

  • Win32 — Peers are exposed as UIAutomation provider nodes. Narrator and other UIAutomation clients query the tree directly.
  • macOS — Each peer becomes an NSAccessibilityElement that VoiceOver can discover.
  • WASM — Each peer produces a hidden DOM element with appropriate ARIA attributes (role, aria-label, aria-checked, etc.).

See also