Suggestions a distance sensor for small area applications

Hi!As I said in the headline, I want to measure the distance of a small object. Object's surface is about 0,5-1 cm^2. Ultrasonic sensors didn't work because of size of the object. Which sensor can I use?

How long distance?

Light based sensors may work.

Not much. 3- 4 cm is enough for me.