ElementInternals: ariaBrailleLabel property

Baseline 2024
Newly available

Since September 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

The ariaBrailleLabel property of the ElementInternals interface reflects the value of the aria-braillelabel attribute, which defines the ARIA braille label of the element.

This element label may be used by assistive technologies that can present content in braille, but should only be set if a braille-specific label would improve the user experience. The aria-braillelabel contains additional information about when the property should be set.

Value

A string that is intended to be converted into braille.

Examples

This example shows how to get and set the ariaBrailleLabel property.

Assuming we have defined a custom element called <star-rating>, in which the element internal's braille label is set to be the value of the element's aria-braillelabel attribute:

js
class StarRating extends HTMLElement {
  constructor() {
    super();
    this._internals = this.attachInternals();
    this._internals.ariaRole = "slider";
    this._internals.ariaBrailleLabel = this.ariaBrailleLabel;
  }

  // …
}

customElements.define("star-rating", StarRating);

And we include the custom element with label text "3 out of 5 stars" and an aria-braillelabel attribute with a value of "3". This allows a braille display to show "slider 3" in braille rather than the more verbose "slider gra 3 out of 5 stars".

html
<star-rating id="rate" aria-braillelabel="3">3 out of 5 stars</star-rating>

The code uses the ariaBrailleLabel property to get and set the braille label.

js
const el = document.querySelector("star-rating");
log(el._internals.ariaBrailleLabel);
el._internals.ariaBrailleLabel += "*";
log(el._internals.ariaBrailleLabel);

Specifications

Specification
Accessible Rich Internet Applications (WAI-ARIA)
# dom-ariamixin-ariabraillelabel

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ariaBrailleLabel
Chrome – Full support
Chrome 107 (Release date: 2022-10-25)
footnote Full support
Edge – Full support
Edge 107 (Release date: 2022-10-27)
footnote Full support
Firefox – Full support
Firefox 125 (Release date: 2024-04-16)
footnote Full support
Opera – Full support
Opera 93 (Release date: 2022-11-17)
footnote Full support
Safari – Full support
Safari 18 (Release date: 2024-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 107 (Release date: 2022-10-25)
footnote Full support
Firefox for Android – Full support
Firefox for Android 125 (Release date: 2024-04-16)
footnote Full support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – Full support
Safari on iOS 18 (Release date: 2024-09-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – Full support
WebView Android 107 (Release date: 2022-10-25)
footnote Full support
WebView on iOS – Full support
WebView on iOS 18 (Release date: 2024-09-16)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

See also