© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
17 replies
Veur

Determine Toggle label by state

Is there a way to change the label of a
\Filament\Forms\Components\Toggle
\Filament\Forms\Components\Toggle
based on its value?
This is what I tried, but it doesn't work:

Toggle::make('active')
    ->label(fn ($record) => $record->active ? 'Active' : 'Inactive')
Toggle::make('active')
    ->label(fn ($record) => $record->active ? 'Active' : 'Inactive')
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

Toggle Column Dynamic Label
FilamentFFilament / ❓┊help
2y ago
Toggle Column maintain state
FilamentFFilament / ❓┊help
3y ago
State of multiple toggle buttons
FilamentFFilament / ❓┊help
2y ago
Disable Toggle Column by button
FilamentFFilament / ❓┊help
3y ago