A static copy of the demo at release 0.3.0. Live Components, Turbo Streams and form submits need Symfony: run the full demo.

Toggle

component

Use the toggle component to switch between a binary state of true or false using a single click available in multiple sizes, variants, and colors

Install

php bin/console ux:install toggle \
    --kit=https://github.com/xormania/uxor:0.3.0

README Source

What it installs

Copies
templates/ → templates/
Composer
twig/html-extra:^3.24.0
symfony/ux-twig-component:^3.5
tales-from-a-dev/twig-tailwind-extra:^1.3.0

Examples (2)

Default

Light
Dark
Code
<twig:Toggle id="checked" value="" checked>
    Toggle me
</twig:Toggle>

Disabled

Light
Dark
Code
<div class="flex flex-col gap-3">
    <twig:Toggle id="checked" value="" disabled>
        Toggle me
    </twig:Toggle>

    <twig:Toggle id="checked" value="" checked disabled>
        Toggle me
    </twig:Toggle>
</div>