F
Filament17mo 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)
Solution:
you can use a view component + css https://filamentphp.com/docs/2.x/forms/layout#view ```php View::make('custom-view')...
Filament
Layout - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
Jump to solution
8 Replies
Dennis Koch
Dennis Koch17mo ago
1. Use any of the Layout components together with ->columns() 2. I think it's ->inline() or ->inlineLabel() 3. Use a layout component around them
dyo
dyoOP17mo ago
what should i do to make the inline options below the label i've tried
php
Radio::make('status')->options([
'Aktif' => 'Aktif',
'Tidak Aktif' => 'Tidak Aktif',
'Selesai' => 'Selesai'
])->label('Status campaign')->default('Aktif')->inline()
php
Radio::make('status')->options([
'Aktif' => 'Aktif',
'Tidak Aktif' => 'Tidak Aktif',
'Selesai' => 'Selesai'
])->label('Status campaign')->default('Aktif')->inline()
dyo
dyoOP17mo ago
like this
LeandroFerreira
LeandroFerreira17mo ago
Group::make([
Placeholder::make('Status Campign'),
Radio::make('Status Campign')
->options([...])
->inline()
->disableLabel()
])->columns(1)
Group::make([
Placeholder::make('Status Campign'),
Radio::make('Status Campign')
->options([...])
->inline()
->disableLabel()
])->columns(1)
? or this
Fieldset::make('Status Campign')
->schema([
Radio::make('Status Campign')
->options([...])
->inline()
->disableLabel()
])
Fieldset::make('Status Campign')
->schema([
Radio::make('Status Campign')
->options([...])
->inline()
->disableLabel()
])
dyo
dyoOP17mo ago
i've chosen using the group, but how can i customize the gap that is too big? i've tried using extraAttributes
Group::make([
Placeholder::make('Status campaign'),
Radio::make('status')->options([
'Aktif' => 'Aktif',
'Tidak Aktif' => 'Tidak Aktif',
'Selesai' => 'Selesai'
])->inline()->disableLabel()
])->columns(1)
->extraAttributes(['class' => 'gap-2']),
Group::make([
Placeholder::make('Status campaign'),
Radio::make('status')->options([
'Aktif' => 'Aktif',
'Tidak Aktif' => 'Tidak Aktif',
'Selesai' => 'Selesai'
])->inline()->disableLabel()
])->columns(1)
->extraAttributes(['class' => 'gap-2']),
dyo
dyoOP17mo ago
Solution
LeandroFerreira
LeandroFerreira17mo ago
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()
])
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>
<!-- custom-view.blade.php -->
<div>
<span class="text-sm font-medium">
{{ $getLabel() }}
</span>
{{ $getChildComponentContainer() }}
</div>
Filament
Layout - Form Builder - Filament
The elegant TALL stack form builder for Laravel artisans.
dyo
dyoOP17mo ago
this is help, a lot.. thanks..
Want results from more Discord servers?
Add your server