Semantic HTML output for web #5183
Replies: 2 comments
-
Hi @mwarger, we are currently providing the semantic tags for Input components as well as the Image component. We have created a PR for rendering Heading component as heading (h1, h2, etc) tags. Talking about the button, the package that you have provided also doesn't support button and is pointing towards the React Native package for same. They are also using current output for Button to a div with a role of "button" which is acceptable by aria accessibility role for the button. You can read it more here. Although we have also asked RN web for same. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Description
Based on this discord comment and subsequent discussion:
https://discord.com/channels/785491682719301643/851763434436558858/948684137135476767
I would like for native-base elements on the web to output semantically correct HTML elements.
Example: should output a element on web. Right now it outputs a div with a role of "button".
Problem Statement
For web usability and accessibility, semantically correct HTML is a good thing to have. This allows for easier selecting (especially in the case of testing and tools like cypress or storybook).
Proposed Solution or API
https://github.com/expo/expo/tree/master/packages/html-elements
This package provides a good example. I believe this could also be used even in projects that don't depend on Expo, but I'm not sure. Leveraging expo uni-modules, in any case, might be a good thing to consider as well?
Alternatives
No response
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions