Toggle Visibility#
Demo#
Explanation#
This example displays how to toggle visibility using the data-show
attribute.
<div
id="container"
class="flex flex-col gap-4"
data-signals={ templ.JSONString(signals) }
>
<button
class="btn btn-primary"
data-on-click="bindBool.value=!bindBool.value">
Toggle
</button>
<div data-show="bindBool.value">
Hello!
</div>
</div>