DaisyUIComponents.Swap (DaisyUIComponents v0.7.6)

View Source

Select component

https://daisyui.com/components/swap

Summary

Functions

Render a Swap component

Attributes

  • class (:any) - Defaults to nil.
  • mode (:string) (required) - Must be one of "on", or "off".
  • name (:string) (required)
  • type (:string) - Defaults to "label".

Functions

swap(assigns)

Render a Swap component

Examples

<.swap >
  <:swap_on name="ON" />
  <:swap_off name="OFF" />
</.swap>

with theme controller

<.swap >
  <:controller>
    <input type="checkbox" class="theme-controller" value="synthwave" />
  </:controller>
  <:swap_on name="ON" />
  <:swap_off name="OFF" />
</.swap>

Attributes

  • class (:any) - Defaults to nil.
  • animation (:string) - Must be one of "flip", or "rotate".
  • Global attributes are accepted.

Slots

  • swap_on - the child element that should be visible when checkbox is checked or when swap is active. Accepts attributes:
    • type (:string) - Must be one of "label", or "icon".
    • name (:string) (required)
  • swap_off - The child element that should be visible when checkbox is not checked or when swap is not active. Accepts attributes:
    • type (:string) - Must be one of "label", or "icon".
    • name (:string) (required)
  • controller - The swap input controller.

swap_mode(assigns)

Attributes

  • class (:any) - Defaults to nil.
  • mode (:string) (required) - Must be one of "on", or "off".
  • name (:string) (required)
  • type (:string) - Defaults to "label".