Metasurfaces are highly versatile for manipulating the amplitude, phase, or polarization of light. During the last decade, metasurfaces have been proposed for a vast range of applications--from imaging and holography to the generation of complex light field patterns. Yet, most optical metasurfaces developed to date are isolated optical elements that work only with external light sources.