Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

myregistration's avatar

Replace Tooltip "Copy" with "Copied" after copied to Clipboard

I think Filament uses ryangjchandler/alpine-tooltip which uses Tippy. I am using a suffixAction clipboard icon and want to replace the tooltip content "Copy" with "Copied" once the user has clicked on a clipboard icon? How can I access that element? It seems tricky. I can set a notification instead, but I'd rather update the tooltip content.

->suffixAction(function (Get $get) {

                            return  \Filament\Forms\Components\Actions\Action::make('Copy')

                                ->tooltip('Copy Link')
                                ->icon('heroicon-s-clipboard')
                                ->action(function (Component $livewire, $state) {

                                    $livewire->dispatch('copy-to-clipboard', text: $state);

                                    Notification::make()
                                        ->success()
                                        ->title('Copied')
                                        ->body("Link copied to clipboard.")
                                        ->send();
                                });
                        })
0 likes
0 replies

Please or to participate in this conversation.