components
Tailwind CSS Swap
Swap enables you to toggle the visibility of two elements using either a checkbox or a class name.
Utilize the swap
component class along with an empty checkbox input and child component classes swap-off
and swap-on
to create a swap component.
Use below given example for volume/mute swap component.
Apply the modifier class swap-rotate
to enable a rotate effect for the swap component.
Use below given example for hamburger button.
Apply the modifier class swap-flip
to enable a flip effect for the swap component.
Utilize the component class swap-js
to designate a specific swap component for JavaScript functionality, allowing the swap to function without a checkbox. Toggling the modifier class swap-active
on a click event of the swap component facilitates this behavior.
Use below given example for RTL swap.
Use below given example for play-pause button.