Skip to main content

Accessibility

FSharp.ViewEngine provides semantic HTML and WAI-ARIA helpers, while the application remains responsible for correct roles, names, states, focus behavior, contrast, and keyboard interaction.

On this page

Overview

FSharp.ViewEngine provides semantic HTML and WAI-ARIA helpers, while the application remains responsible for correct roles, names, states, focus behavior, contrast, and keyboard interaction.

Prefer native HTML

Start with the native element whose behavior matches the interaction. A button already supplies keyboard activation semantics that a clickable div does not.

button {
    _type "button"
    _ariaExpanded isOpen
    _ariaControls "account-menu"
    "Account"
}

Names and relationships

Use visible labels where possible and connect controls, descriptions, errors, tabs, and panels with stable unique IDs.

label { _for "email"; "Email" }
input {
    _id "email"
    _type "email"
    _ariaDescribedBy "email-help"
}
p { _id "email-help"; "Used for account notices." }

ARIA coverage

Dedicated helpers cover WAI-ARIA 1.2 attributes. Use the generic _aria helper only for future or extension attributes not represented by the pinned inventory.

Test behavior

Rendering valid attributes is not enough. Test focus movement, keyboard operation, expanded/selected state, labels, landmarks, responsive behavior, and light/dark contrast in the running interface.