Tooltip for suffixIcon possible?
Currently I'm creating an TextInput field with a suffix icon. Is it possible to give this suffix icon a tooltip?
11 Replies
Just curious, what's the use for this tooltip? Is this an action or just some extra information on a static icon?
Not pretty but I think this should work:
@pboivin its a tooltip for an action, which is actually my second question. Let me give you some more information.
I have a TextInput field with an icon on the right side indicating the contents of this input is copyable. When the user presses the icon, I want to copy the value of that input to the clipboard (still don't know how to do this...). My question was, how can I show a tooltip when hovering over that copy icon on the right side?
Not sure about "tooltip" but you can check copy-action here https://filamentglow.com/trick/copied-to-clipboard-on-suffix-action-2768391d
@Vp thanks, I'll check it out
@Vp It works, but the tooltip for saying "copied to clipboard" is shown on the top, instead of above the icon
Yes, that one I don't know how to change for now
And for tooltip you can use
->tooltip()
inside action@Vp alternative approach would be:
@Vp do you maybe know how to make my code above macroable? I would like to reuse this on different pages and resources
Like so:
Ill check it out if I can use Laravel's Macroable on Filament stuff
Action extends Component, and Component is Macroable, so lets see
Just do this way,
use Filament\Forms\Components\Actions\Action;
and it should work. I've done using like this for "table filter" and it's work perfect
laravel link is for where to define your macro.
and you call this macro like this, maybe need to passed $state
in ->myCopyable($state)
Yeah, i got it.. Give me a sec, and ill show you the mixin im creating and testing
@Vp here you go:
Super 👍