Draw outline over ui image element

I am trying to create an animation which draws an outline around an image gameobject when i select one. The outline should be drawn around the image in time t which is taken as a parameter.

There is indeed an outline component for these gameobjects but i havent found any way to draw out the animations. I want to reuse this functionality in other items which have an outline component with the same script.

Is this really possible? Or should i let go of this feature?