FilamentF
Filament3y ago
dyo

about form layout

Sorry, i've a bunch of question about form layout..

  1. How can I have a grid inside grid? (red mark)
  2. How can I have radio component with label above inline options? (blue mark)
  3. How can I have 2 toggle component in one line of other TextInput component? (brown mark)
image.png
Solution
you can use a view component + css
https://filamentphp.com/docs/2.x/forms/layout#view

View::make('custom-view')
    ->label('Status campaign')
    ->schema([
        Radio::make('status')->options([
            'Aktif' => 'Aktif',
            'Tidak Aktif' => 'Tidak Aktif',
            'Selesai' => 'Selesai'
        ])
        ->inline()
        ->disableLabel()
    ])


<!-- custom-view.blade.php -->
<div>
    <span class="text-sm font-medium">
        {{ $getLabel() }}
    </span>
    {{ $getChildComponentContainer() }}
</div>
Filament
The elegant TALL stack form builder for Laravel artisans.
Was this page helpful?