open-vault/ui/stories/toggle-button.md

1.3 KiB

ToggleButton

ToggleButton components are used to expand and collapse content with a toggle.

Param Type Default Description
toggleAttr String The attribute upon which to toggle.
attrTarget Object The target upon which the event handler should be added.
[openLabel] String Hide options - The message to display when the toggle is open.
[closedLabel] String More options - The message to display when the toggle is closed.

Example

  <ToggleButton
    @openLabel="Encrypt Output with PGP"
    @closedLabel="Encrypt Output with PGP"
    @toggleTarget={{this}}
    @toggleAttr="showOptions"/>
 {{#if showOptions}}
    <div>
      <p>
        I will be toggled!
      </p>
    </div>
  {{/if}}

See