--- title: Swap desc: Swap allows you to toggle the visibility of two elements using a checkbox or a class name. source: https://raw.githubusercontent.com/saadeghi/daisyui/refs/heads/master/packages/daisyui/src/components/swap.css layout: components classnames: component: - class: swap desc: Swap container part: - class: swap-on desc: The child element that should be visible when checkbox is checked or when swap is active - class: swap-off desc: The child element that should be visible when checkbox is not checked or when swap is not active - class: swap-indeterminate desc: The child element that should be visible when checkbox is indeterminate modifier: - class: swap-active desc: Activates the swap (no need for checkbox) style: - class: swap-rotate desc: Adds rotate effect to swap - class: swap-flip desc: Adds flip effect to swap --- ### ~Swap text ```html ``` ### ~Swap volume icons ```html ``` ### ~Swap icons with rotate effect ```html ``` ### ~Hamburger button ```html ``` ### ~Swap icons with flip effect ```html ``` ### ~Activate using class name instead of checkbox #### Instead of working with click, it shows swap-on item if you add swap-active class name. You can add or remove swap-active class using JS