<hx-disclosure>
v0.2.0+
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:
- It should have an
idattribute. -
It should respond to an
openproperty that reflects to anopenattribute.
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-expandedattribute.- Set to
trueto expand the target element. - Set to
falseto collapse the target element.
- Set to