© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
8 replies
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',
    ]),
image.png
Solution
Merged
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

extraAttributes on Form components
FilamentFFilament / ❓┊help
3y ago
Dynamically change Form component in Repeater
FilamentFFilament / ❓┊help
2y ago
where to search extraAttributes() ?
FilamentFFilament / ❓┊help
3y ago
Custom field layout component does not pass $extraAttributes to blade
FilamentFFilament / ❓┊help
3y ago