Second tip in the Filament Up to Date series: ToggleButtons got two new methods.
size()
Sets the size to small, medium, or large. You can also pass a closure. The default is medium.
use Filament\Forms\Components\ToggleButtons;
use Filament\Support\Enums\Size;
ToggleButtons::make('status')
->options(OrderStatus::class)
->size(Size::Large);
fullWidth()
Stretches the toggle buttons across the full width of the field. It works with stacked, grouped, and inline layouts.
ToggleButtons::make('status')
->options(OrderStatus::class)
->fullWidth();
When to use them
-
size()fits dense forms (small) or touch-friendly screens (large). -
fullWidth()suits a status selector that should line up with the other fields in your form.
Pull requests
Thanks @getupkid (PR #20517) and @caseydwyer (PR #20520) for contributing this! 🙌
📚 All tips in this series: devdeia.com/filament-up-to-date

Top comments (0)