Elemental.Actions.Swap (elemental v0.3.1)

A simple swap component.

Allows for alternative between two HTML elements (or subtrees) when clicked. Comprised of an underlying checkbox to control the state of the which element to show.

Usage

<.swap>
  <:on>ON</:on>
  <:off>OFF</:off>
</.swap>

Summary

Functions

The primary swap component.

Functions

swap(assigns)

The primary swap component.

Attributes

  • animate (:string) - Control the animation to use when doing the swap. Defaults to "default".
  • Global attributes are accepted.

Slots

  • on (required) - The required on state content.

  • off (required) - The required off state content.

    If indeterminate slot is not given this will be the default state the component starts in.

  • indeterminate - An optional indeterminate state content.

    If given the inner checkbox be immediately set to indeterminate once it first mounts.