Logos DX
    Preparing search index...

    Function aria

    • Set, get, or manage ARIA attributes on DOM elements. Auto-prefixes keys with aria- so callers use short names.

      Parameters

      Returns void

      aria(el, { pressed: 'true' });   // sets aria-pressed="true"
      aria(el, 'pressed'); // → 'true'
      aria(el, ['pressed', 'expanded']); // → { pressed: 'true', expanded: null }
      aria.remove(el, 'pressed');
      aria.role(el, 'button');
      aria.hide(el);
    • Set, get, or manage ARIA attributes on DOM elements. Auto-prefixes keys with aria- so callers use short names.

      Parameters

      Returns string | null

      aria(el, { pressed: 'true' });   // sets aria-pressed="true"
      aria(el, 'pressed'); // → 'true'
      aria(el, ['pressed', 'expanded']); // → { pressed: 'true', expanded: null }
      aria.remove(el, 'pressed');
      aria.role(el, 'button');
      aria.hide(el);
    • Set, get, or manage ARIA attributes on DOM elements. Auto-prefixes keys with aria- so callers use short names.

      Parameters

      Returns Record<string, string | null>

      aria(el, { pressed: 'true' });   // sets aria-pressed="true"
      aria(el, 'pressed'); // → 'true'
      aria(el, ['pressed', 'expanded']); // → { pressed: 'true', expanded: null }
      aria.remove(el, 'pressed');
      aria.role(el, 'button');
      aria.hide(el);
    Index

    Properties

    Methods

    Properties

    label: (el: HTMLElement, value?: string) => string | void | null

    Get or set aria-label.

    aria.label(el, 'Submit form');
    aria.label(el); // → 'Submit form'
    role: (el: HTMLElement, value?: string) => string | void | null

    Get or set the role attribute. Unlike other ARIA attributes, role has no aria- prefix.

    aria.role(el, 'button'); // sets role="button"
    aria.role(el); // → 'button'

    Methods

    • Remove one or more ARIA attributes from one or more elements. Auto-prefixes with aria-.

      Parameters

      Returns void

      aria.remove(el, ['pressed', 'expanded']);
      aria.remove([el1, el2], 'hidden');