• Provides a toggle action for details HTML elements. The boolean store when provided controls open / closed state. Animation is accomplished using WAAPI controlling the height of the details element. It should be noted that this animation may cause layout thrashing (reflows) depending on the amount of DOM elements on the page though this doesn't occur under most situations. Animation can be toggled on / off with the animate option.

    It is not necessary to bind the store to the open attribute of the associated details element.

    When the action is triggered to close the details element a data attribute closing is set to true. This allows any associated closing transitions to start immediately.

    Parameters

    • details: HTMLDetailsElement

      The details element.

    • Optionalopts: {
          animate?: boolean;
          clickActive?: boolean;
          store: MinimalWritable<boolean>;
      }

      Options parameters.

      • Optionalanimate?: boolean

        When true animate close / open state with WAAPI.

      • OptionalclickActive?: boolean

        When false click events are not handled.

      • store: MinimalWritable<boolean>

        A minimal writable boolean store.

    Returns ActionReturn

    Lifecycle functions.