davidhu2000 / react-spinners

A collection of loading spinner components for react
https://www.davidhu.io/react-spinners
MIT License
3.1k stars 265 forks source link

Support for ALT Text or Aria labels #353

Closed khibma closed 2 years ago

khibma commented 3 years ago

Is your feature request related to a problem? Please describe. I was looking to add alt-text or better yet, aria-labels to the spinners to make them more accessible.

Describe the solution you'd like I've tried adding a span or straight text into the loader; nothing will render on screen, nor do I see it in the generated source. I've also tried adding aria-labels to the component, but they appear to be ignored.

     <ClockLoader
          css={override}
          size={20}
          color={"#000"}
          loading={this.state.spinner}
          aria-label = "loading"      
        > 

          Working....
          {/* screen-reader-only */}
          <span className='sr-only'>Generating report</span>
        </ClockLoader>
davidhu2000 commented 3 years ago

that's a good idea. i can probably just allow all additional props so you can add as many as you need, even data props should work. i think this could be a good feature to implement.

davidhu2000 commented 2 years ago

this is supported in 0.13.0-alpha.4