Align a toggle to the right of a field
Hi,
I'm trying to set up a form with a title input and a slug input. The slug is autmatically generated from the title, but I'd like the user to have the option of editing the slug. Visually it would be nice to place the toggle to the right of the input box. I'm wondering whether there is an elegant solution for this available in Filament? This is my current code (i haven't added any reactivity to the toggle yet)
I've attached a screenshot for how it currently renders.
4 Replies
this is how i'd do it:
setup a grid component with 3 cols
each item in the schema ->colSpan(1)
Went a different way with this in the end and used Form Actions to lock and unlock the field. Code needs a bit of refactoring but it looks like this now -
You can also use a
hintAction
https://filamentphp.com/docs/3.x/forms/actions#adding-a-hint-action-to-a-fieldOh nice