Skip to content

feat(microchart-bar): improve accessibility#1734

Draft
akashsonune wants to merge 1 commit intomainfrom
feat/improve-accessibility-micro-bar-chart
Draft

feat(microchart-bar): improve accessibility#1734
akashsonune wants to merge 1 commit intomainfrom
feat/improve-accessibility-micro-bar-chart

Conversation

@akashsonune
Copy link
Member

@akashsonune akashsonune commented Mar 24, 2026

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the SiMicrochartBarComponent by adding an img role for accessibility. However, the review points out that this implementation is incomplete and suggests adding an aria-label with a corresponding input property to provide an accessible name for screen readers.

Comment on lines +32 to +34
host: {
role: 'img'
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding role='img' is a good first step for accessibility, but it's incomplete. An element with an image role must have an accessible name, otherwise screen readers will announce it as an 'unlabeled image', which is not helpful.

To fix this, you should provide an accessible name via aria-label. The suggestion below adds this binding to the host. To make it work, you'll also need to add a corresponding ariaLabel input to the component class:

/**
 * Accessible label for the chart.
 * @defaultValue ''
 */
ariaLabel = input<string>('');

This will allow consumers of the component to provide a meaningful description of the chart for assistive technologies.

  host: {
    role: 'img',
    '[attr.aria-label]': 'ariaLabel()'
  }

Copy link
Member Author

@akashsonune akashsonune Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dr-itz WDYT, the role=img has to be supported by the aria-label to have a real improvement. shall we let user take care of this,i.e to provide the aria-label?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant