Replies: 2 comments 3 replies
-
|
This looks good to me and would be a welcome contribution. |
Beta Was this translation helpful? Give feedback.
3 replies
-
|
@chrstnb : simply put, thank you for introducing this support and providing accessible experiences! 🦸♀️ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
We're using Ink for gemini-cli and are seeing issues with compatibility with screen readers (e.g., google-gemini/gemini-cli#1553).
To address this, I started attempting to make changes to our repo, but then I figured it might actually make sense to start by adding support to ink. I'm working on getting feedback from screen reader users, but wanted to open up here first!
My questions are:
If no concerns about the above, I'll put up a PR and start getting feedback from screen reader users on the approach!
Initial proposal would look something like this:
Screen Reader Support
To enable screen reader support, you can either pass the
isScreenReaderEnabledoption to therenderfunction or set theINK_SCREEN_READERenvironment variable totrue.render(<MyApp />, {isScreenReaderEnabled: true});When screen reader support is enabled, Ink renders a text-based, screen-reader-friendly version of the UI instead of the visual one.
For example, this UI:
For a screen reader, the output will be:
Accessibility Props
To create a more accessible UI, you can use the following props, which are only used when screen reader support is enabled.
accessibilityLabelYou can use the
accessibilityLabelprop on<Box>,<Text>, and<Transform>components to provide a custom, screen-reader-specific output. This label will replace the component's children in the screen reader output.accessibilityRoleUse the
accessibilityRoleprop on a<Box>to define its role, such as a button or checkbox. This helps screen reader users understand the element's function.Supported roles:
'button','checkbox','radio','radiogroup','list','listitem','menu','menuitem','progressbar','tab','tablist',table,'timer','toolbar'.In screen reader mode will be:
accessibilityStateUse the
accessibilityStateprop on a<Box>to describe its current state. This is useful for interactive components.Supported states:
checked,disabled,expanded,selected.This will output as
checkbox: Accept terms and conditions (checked)in screen reader mode.Beta Was this translation helpful? Give feedback.
All reactions