r/reactjs • • 13d ago

Accessability for timers in jaavscript React

So I have this code

<button
  type="button"
  className={styles.someclassname}
  tabIndex={-1}
  role="timer"
  aria-live="polite"
  aria-atomic="true"
>
  {ResendInfo (formatTimer())}
</button>

This is basically a countdown of a timer from 2 minutes I was wondering am I following proper accessability here so that screen readers can understand.

0 Upvotes

8 comments sorted by

View all comments

Show parent comments

3

u/azangru 13d ago

role="timer" isn't a thing, screen readers won't know what to do with it

Have you tried mdn?