konstaui / konsta

Mobile UI components made with Tailwind CSS
https://konstaui.com
MIT License
3.3k stars 119 forks source link

A11y: improve a11y capability, adding ARIA roles #155

Closed BobH-Official closed 9 months ago

BobH-Official commented 9 months ago

Clear and concise description of the problem

svelte vite plugin returns such warnings:

[vite-plugin-svelte] /node_modules/.pnpm/konsta@2.0.0/node_modules/konsta/svelte/components/icons/DeleteIcon.svelte:21:2 A11y: <svg> with click handler must have an ARIA role ... etc.

Suggested solution

According to MDN: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role

It should be easy to add A11y support, by adding a new attribute role="button" to the element.

<div role="button">Title of my button</div>

Alternative

No response

Additional context

Another issue about A11y: https://github.com/konstaui/konsta/issues/92

Validations

Would you like to open a PR for this feature?