How can I popup the image when the raycast/point hit the object?

Hello everyone, I want to ask something regarding the popup text/image.

I want to do some learning tools in which when the point of a ray cast hit the object it will pop up the text or image of the object.

For example, when I point the dot at the table it will appear a popup text of the table like “Table”. But for the popup, I want to insert an image instead of the text.

Thank you and I hope there has an answer for me.

The simplest solution i can think of is to attach simple script with Sprite variable inside, and on Raycast hit just get this sprite and set it to UI Image.

public class RaycastMaasterOrWhatever
	[SerializeField] Image _PopupImage;

    void FunctionWIthRaycast()
	      // code with raycast
	     _PopupImage.sprite = objectHit.GetComponent<SimpleScriptWithSprite>().GetSprite();

public class SimpleScriptWithSprite
	[SerializeField] Sprite _Sprite;
    public Sprite GetSprite() => _Sprite;