Skip to content

Alpine.js Toolkit

@ailuracode · Interactive plugin demos

Toggle

Binary and ternary toggle state factories for segmented controls and filters.

Magic$toggle
Read Documentation@ailuracode/alpine-toggle
Toggle$toggle
Binary and ternary toggle state factories for segmented controls and filters.

Binary — bindings read power.value directly so Vue's reactive proxy tracks the dependency and re-evaluates on every transition.

Power:id:

Ternary — same rule: bind to answer.value directly so the binding tracksvalue as a dependency.

Answer:

Hydration via setSilently() — first change event is the user toggle, not the seed.

Hydrated mode:from localStorage

Package: @ailuracode/alpine-toggle