Accessibility (a11y)
Ensures dynamic attributes like, aria-expanded, are properly updated and that non-interactive elements like <div> tags are keyboard actionable when required.
No Attributes needed.
There are no fs-a11y attributes to apply to the page.
A11y seamlessly integrates with new component solutions launching next week.
What does Attributes A11y do?
Attributes A11y helps manage dynamic, or state based, accessibility attributes.
A11y will look for attributes, like aria-expanded, on the page and apply the required JavaScript to change its value.
A11y works with other Attributes solutions to make sure our components are accessible. Next week we launch modals, accordions, and other components.
Example using our new Modal solution
Below is documentation of everything A11y does when we use the Attributes Modal solution. We use fs-modal to explain what fs-a11y does.
In this case, ensures that open/close triggers that are created using non-interactive tags like <div> are still keyboard-actionable.
Applied to:
- Open triggers.
- Close triggers.
When used in conjunction with role=”button”, fs-a11y ensures that all non-interactive tags like <div> can be actioned using the Space and Enter keys.
role="button"
As the native <button> tag is not available to use in the Webflow Designer, this attribute ensures that screen readers don’t confuse the trigger for a navigation link when using Webflow’s Button component (the Button component is actually an <a> tag on the published page).
It also ensures that the triggers are correctly recognized by screen readers when they are non-interactive tags like a <div>.
Applied to:
- Open triggers.
- Close triggers.
When used in conjunction with tabindex=”0”, fs-a11y ensures that all non-interactive tags like <div> can be actioned using the Space and Enter keys.
Applied to:
- Open triggers: description should be human-readable like aria-roledescription="open-modal-trigger".
- Close triggers: description should be human-readable like aria-roledescription="close-modal-trigger".
For example, the modal that is being opened/closed when clicking it.
Requires the target element (the modal) to have a unique ID.
Via this attribute, fs-a11y can observe the target element and update the aria-expanded attribute accordingly.
Applied to:
- Open triggers.
- Close triggers.
fs-modal also ensures that the modals have a unique ID by generating a new one when there are duplicated IDs on a same page.
aria-expanded="true | false"
For example, indicating if the modal is currently opened or closed.
Applied to:
- Open triggers.
- Close triggers.
This attribute is updated automatically by fs-a11y when the modal opens / closes.
aria-haspopup="dialog"
Applied to:
- Open triggers.
- Close triggers.
Requires the element to have a label so screen readers can provide contextual information to the users. This can be achieved either by adding an aria-label attribute or an aria-labelledby attribute.
Applied to:
- Modal
When used, fs-a11y ensures that the focus management requirements of a dialog are met:
- Automatically focuses the first focusable element in the modal.
- Traps the focus inside the modal.
- When closed, returns the focus back to the open trigger.
- Closes the modal when pressing the Esc key.
aria-modal="true"
Applied to:
- Modal
aria-labelledby="LABEL_ID"
aria-label="LABEL_TEXT"
Applied to:
- Modal, if aria-labelledby is not set up.
- Open and close triggers, if they don’t contain any readable text. For example, a button with just an X icon should have something like aria-label="Close the modal".