carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Loader: allow informative, accessible text to be shown and read out

Open damienrobson-sage opened this issue 1 year ago • 2 comments

Desired behaviour

A prop can be passed into the Loader component that allows text to be displayed e.g. underneath the animated icon. It would also be of benefit if said text was picked up correctly by screen readers. This would improve the accessibility and user experience of using loaders for non-sighted users;

Current behaviour

Only the animated loader is shown; extra work and components are needed to allow for text to be displayed alongside (see CodeSandbox)

Suggested Solution

  • Support optional use of text to show alongside the screen reader;
  • Make use of similar to the screenReaderOnly prop in Typography to allow any info text to be read out

CodeSandbox or Storybook URL

https://codesandbox.io/s/suspicious-northcutt-f4g3qt?file=/src/Loading.js

Anything else we should know?

No response

Confidentiality

  • [X] I confirm there is no confidential or commercially sensitive information included.

damienrobson-sage avatar Oct 09 '23 14:10 damienrobson-sage

Hi @damienrobson-sage - this isn't currently something in the DS. It's not something that would be difficult to add, though it seems your implementation of Loader plus two Typography components looks like fine to do from a consumer's end. It might be worthing speaking to the DS team about including this, and see what they say?

Maybe raise it here first? https://github.com/Sage/design-system/issues

nineteen88 avatar Oct 10 '23 13:10 nineteen88

Thanks @nineteen88 - I've opened this issue as a result of your suggestion above

damienrobson-sage avatar Oct 10 '23 15:10 damienrobson-sage

Closing this as there is a workaround available 👍🏼

Parsium avatar Mar 19 '24 14:03 Parsium