Repeater Add button - Icon

I desire to add an icon to add button repeater I deep into code and it seems impossible. So i did it. I write down this help to anyone need the same thing. Overrided the repeater.
$this->app->bind(
\Filament\Forms\Components\Repeater::class,
\App\Filament\Applications\Core\Forms\Components\Repeater::class
);
$this->app->bind(
\Filament\Forms\Components\Repeater::class,
\App\Filament\Applications\Core\Forms\Components\Repeater::class
);
Added HasIcon, I know I lose consistency. It's better to create a dedicated trait and use addActionIcon
class Repeater extends \Filament\Forms\Components\Repeater
{
use HasIcon;

public function getAddAction(): Action
{
$action = Action::make($this->getAddActionName())
->icon(fn (Repeater $component) => $component->getIcon())
->label(fn (Repeater $component) => $component->getAddActionLabel())
->color('gray')
class Repeater extends \Filament\Forms\Components\Repeater
{
use HasIcon;

public function getAddAction(): Action
{
$action = Action::make($this->getAddActionName())
->icon(fn (Repeater $component) => $component->getIcon())
->label(fn (Repeater $component) => $component->getAddActionLabel())
->color('gray')
and finally
->addActionLabel(fn() => __('company::user/form.assign_user_to_repair_shop.table.actions.add'))
->icon('heroicon-m-plus')
->extraActions([
->addActionLabel(fn() => __('company::user/form.assign_user_to_repair_shop.table.actions.add'))
->icon('heroicon-m-plus')
->extraActions([
Maybe I open a PR in future
1 Reply
Dennis Koch
Dennis Koch4w ago
There is no need to overwrite the Repeater. Just use ->addAction(fn ($action) => ...) to modify the action.
Want results from more Discord servers?
Add your server