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

FormField

component

A labelled form control with its help text and error message, wired by id (used by the form theme).

Install

php bin/console ux:install form-field \
    --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 (1)

Default

Light
Dark
Code
<div class="w-full max-w-sm space-y-6">
    <twig:FormField for="email" label="Email" help="We never share it." required>
        <twig:Input id="email" type="email" placeholder="name@example.com" aria-describedby="email_help" required />
    </twig:FormField>
    <twig:FormField for="username" label="Username" error="This username is already taken.">
        <twig:Input id="username" value="bonnie" aria-invalid="true" aria-describedby="username_error" />
    </twig:FormField>
</div>