<hx-disclosure> v0.2.0+ HelixUI v0.2.0 or later required

The custom <hx-disclosure> element provides behavior required to toggle content visibility of a companion <hx-reveal> element.

Target Element

A target element should adhere to the following contract:

  1. It should have an id attribute.
  2. It should respond to an open property that reflects to an open attribute.

Methods

click()
Simulates a mouse click on the element

Attributes

Attributes enable declarative configuration of an element, via HTML markup.

aria-controls
The ID of a target element to associate behavior. Required to wire up display functionality between elements.
aria-expanded*
Automatically initialized to the same state as the target element. When attribute is updated, target element is updated as well.
role*
Automatically set to "button", unless explicitly defined in markup.
tabindex*
Automatically set to "0", unless explicitly defined in markup.

Properties

JavaScript properties enable programmatic access to an element's configuration and state.

expanded {Boolean}
Mirrors the aria-expanded attribute.
  • Set to true to expand the target element.
  • Set to false to collapse the target element.

See Also