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
awcodes17mo ago
Maybe ->icon(false)
arnaucreagia
arnaucreagiaOP17mo ago
tried and nope It shows an error message saying it needs a $name
Matthew
Matthew17mo ago
Can you give more information? What type of Action is it?
arnaucreagia
arnaucreagiaOP17mo ago
Is a TextInput Action
Dennis Koch
Dennis Koch17mo ago
Please provide some code.
arnaucreagia
arnaucreagiaOP17mo 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
Matthew17mo ago
Which import do you have for Action
arnaucreagia
arnaucreagiaOP17mo ago
Filament\Forms\Components\Actions\Action
Matthew
Matthew17mo ago
How can the import be Actions but the component Action?
arnaucreagia
arnaucreagiaOP17mo ago
Sry I typed wrong
Matthew
Matthew17mo ago
Hm, as far as I can see I dont think that possible (yet) Might submit a PR
arnaucreagia
arnaucreagiaOP17mo ago
Ty, I think it would be useful
Solution
awcodes
awcodes17mo 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
arnaucreagiaOP17mo ago
Ty! Didn't think this one
Want results from more Discord servers?
Add your server