© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
9 replies
leoPascal

is it possible to have ToggleColumn with text in filament v2?

Hello all,

In my form I have toggle field is_submitted like this and it works absolutely fine.

Toggle::make('is_submitted')->label('Change here')->inline(false)->default(false)->reactive()
                                ->afterStateUpdated(function ($state, $set){}) ->onColor('success')
                                ->offColor('danger'),  
                                Placeholder::make('status')->label('Currently')->content(function ($state, $get) {
                                    $status = $get('is_submitted') === true ? 'Submitted' : 'Not Submitted';
                                    $style = $status === 'Submitted' ? 'color: green;' : 'color: red;';
                                    return new HtmlString("<span style='" . $style . "'>" . $status . "</span>");
                                })->extraAttributes(['class' => 'text-primary-500 mt-15 items-center font-bold text-xs']),
Toggle::make('is_submitted')->label('Change here')->inline(false)->default(false)->reactive()
                                ->afterStateUpdated(function ($state, $set){}) ->onColor('success')
                                ->offColor('danger'),  
                                Placeholder::make('status')->label('Currently')->content(function ($state, $get) {
                                    $status = $get('is_submitted') === true ? 'Submitted' : 'Not Submitted';
                                    $style = $status === 'Submitted' ? 'color: green;' : 'color: red;';
                                    return new HtmlString("<span style='" . $style . "'>" . $status . "</span>");
                                })->extraAttributes(['class' => 'text-primary-500 mt-15 items-center font-bold text-xs']),


and this is the ToggleColumn in the table
ToggleColumn::make('is_submitted')->label('Status')->onColor('success')
  ->offColor('danger'),
ToggleColumn::make('is_submitted')->label('Status')->onColor('success')
  ->offColor('danger'),


I want to give the same text like 'Submitted' or 'Not Submitted' in the ToggleColumn of my table, is this acheiveable?
image.png
image.png
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

Is it possible to hide selected row from table in filament v2?
FilamentFFilament / ❓┊help
3y ago
it is possible to implement Ckeditor in filament?
FilamentFFilament / ❓┊help
2y ago
Is it possible to generate barcode in filament?
FilamentFFilament / ❓┊help
3y ago
Is it possible to use filament table in filament form now?
FilamentFFilament / ❓┊help
2y ago