Is it possible to hide a action's icon and just show a label?

Tried with label() but nothing. Ty
Solution:
Just don't use the icon at all and tell it to be a button. This works for me: ```php Action::make('dniValidation') ->label('Comprova') ->button()...
Jump to solution
14 Replies
awcodes
awcodes2y ago
Maybe ->icon(false)
arnaucreagia
arnaucreagiaOP2y ago
tried and nope It shows an error message saying it needs a $name
Matthew
Matthew2y ago
Can you give more information? What type of Action is it?
arnaucreagia
arnaucreagiaOP2y ago
Is a TextInput Action
Dennis Koch
Dennis Koch2y ago
Please provide some code.
arnaucreagia
arnaucreagiaOP2y ago
TextInput::make('id_card')
->label('DNI')
->suffixAction(
Action::make('dniValidation')
->label('Comprova')
->icon('heroicon-o-check')
->action(function () {
return true; //example
})
),
TextInput::make('id_card')
->label('DNI')
->suffixAction(
Action::make('dniValidation')
->label('Comprova')
->icon('heroicon-o-check')
->action(function () {
return true; //example
})
),
I want the Action to show 'Comprova' and not the icon. Right now it just shows the icon.
Matthew
Matthew2y ago
Which import do you have for Action
arnaucreagia
arnaucreagiaOP2y ago
Filament\Forms\Components\Actions\Action
Matthew
Matthew2y ago
How can the import be Actions but the component Action?
arnaucreagia
arnaucreagiaOP2y ago
Sry I typed wrong
Matthew
Matthew2y ago
Hm, as far as I can see I dont think that possible (yet) Might submit a PR
arnaucreagia
arnaucreagiaOP2y ago
Ty, I think it would be useful
Solution
awcodes
awcodes2y ago
Just don't use the icon at all and tell it to be a button. This works for me:
Action::make('dniValidation')
->label('Comprova')
->button()
->action(function () {
return true; //example
}),
Action::make('dniValidation')
->label('Comprova')
->button()
->action(function () {
return true; //example
}),
arnaucreagia
arnaucreagiaOP2y ago
Ty! Didn't think this one

Did you find this page helpful?