Copyable Action
Filament already has a built-in copy-to-clipboard functionality on the TextColumn and TextEntry. However, this function is not available on filament actions. It would also be nice if this function was in the filament action.
11 Replies
what will the action do?
Copy a text to the clipboard like TextColumn and TextEntry
you want an action when its clicked it will copy more than 1 column?
I want to copy text inside the copyableState
masi gak ngerti gw bang mau actionnya ngapain
Here's a real-world example... I currently have a Media table, it has an ID column that can be copied. TextColumn has copyable() and copyableState() methods that I can use to create that functionality.
The problem is:
1. I need to add a "click to copy" label to the column to indicate that the text can be copied.
2. I don't even need the column to display, I just need to copy the text.
It would be nice to add a button to the table, with copyable() and copyableState() methods, so I could click the button to copy text instead of using TextColumn.
okay i understand
like this?
Here's what the component does to make the element copyable: https://github.com/filamentphp/filament/blob/50bc3a3700419d5cefc0c9ddcaeb8c70476b36c2/packages/tables/resources/views/columns/text-column.blade.php#L101-L112
You could explore making your own component, or extending the component's template, to suit your needs.
GitHub
filament/packages/tables/resources/views/columns/text-column.blade....
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
@Ansori did you ever work this out?
Actually there is a copyable method on the table action Action::make()->copyable(), but when I tried it the action does nothing. Not sure why is not working for me.