© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
7 replies
josef

Toggle in Action does not respect default state

I'm trying to customize the ReplicateAction on a table by showing toggles that allow the user to (de-)select data that is to be replicated. I want all the toggles to be on by default, but using
default(true)
default(true)
on the toggles has no visible effect. They present as
false
false
.

Code:
Tables\Actions\ReplicateAction::make()
                    ->form([
                        Forms\Components\Fieldset::make()
                            ->schema([
                                Forms\Components\Toggle::make('prices')
                                    ->default('true'),
                            ])
                    ])
Tables\Actions\ReplicateAction::make()
                    ->form([
                        Forms\Components\Fieldset::make()
                            ->schema([
                                Forms\Components\Toggle::make('prices')
                                    ->default('true'),
                            ])
                    ])


Result:
image.png
Solution
try
Tables\Actions\ReplicateAction::make()
    ->mountUsing(fn (\Filament\Forms\ComponentContainer $form) => $form->fill())
    ->form([
        Forms\Components\Fieldset::make()
            ->schema([
                Forms\Components\Toggle::make('prices')
                    ->default(true),
            ])
    ])
Tables\Actions\ReplicateAction::make()
    ->mountUsing(fn (\Filament\Forms\ComponentContainer $form) => $form->fill())
    ->form([
        Forms\Components\Fieldset::make()
            ->schema([
                Forms\Components\Toggle::make('prices')
                    ->default(true),
            ])
    ])
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Toggle default true
FilamentFFilament / ❓┊help
10mo ago
custom toggle action
FilamentFFilament / ❓┊help
3y ago
Toggle as Action
FilamentFFilament / ❓┊help
3y ago
Why does FileUpload not respect ->rules() ?
FilamentFFilament / ❓┊help
2y ago