Elemental.Actions.Swap (elemental v0.3.0)
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
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 requiredon
state content.off
(required) - The requiredoff
state content.If
indeterminate
slot is not given this will be the default state the component starts in.indeterminate
- An optionalindeterminate
state content.If given the inner checkbox be immediately set to
indeterminate
once it first mounts.