F
Filament11mo ago
Matthew

Using ->extraAttributes() to change Form Component

I tried to apply some classes to the ToggleButtons component but with no success. Initially my goal was to make the edges more round, but after that didnt work, I tried to apply margin to the component (as a test) but that didnt work either. Am I missing something or applying the wrong key to the array?
ToggleButtons::make('status')
->grouped()
->extraAttributes(['class'=>'mt-10'])
->options([
'draft' => 'Draft',
'scheduled' => 'Scheduled',
'published' => 'Published'
])
->icons([
'draft' => 'heroicon-o-pencil',
'scheduled' => 'heroicon-o-clock',
'published' => 'heroicon-o-check-circle',
]),
ToggleButtons::make('status')
->grouped()
->extraAttributes(['class'=>'mt-10'])
->options([
'draft' => 'Draft',
'scheduled' => 'Scheduled',
'published' => 'Published'
])
->icons([
'draft' => 'heroicon-o-pencil',
'scheduled' => 'heroicon-o-clock',
'published' => 'heroicon-o-check-circle',
]),
No description
Solution:
Merged
Jump to solution
4 Replies
Matthew
MatthewOP11mo ago
And I did run npm run build just to be sure But if I add it to lets say RichEditor, then it works. Could this be a bug?
Matthew
MatthewOP11mo ago
RichEditor::make('description')
->required()
->extraAttributes(['class'=>'mt-10'])
->columnSpan(2)
->autofocus(),
RichEditor::make('description')
->required()
->extraAttributes(['class'=>'mt-10'])
->columnSpan(2)
->autofocus(),
No description
Matthew
MatthewOP11mo ago
Im pretty sure this is a bug. I have submitted a PR with a fix https://github.com/filamentphp/filament/pull/10978
Solution
Matthew
Matthew11mo ago
Merged
Want results from more Discord servers?
Add your server