So-called ‘flat optics’ control the phase of an illuminating wave in free space through shallow subwavelength structures which are also called metalenses, or more generally metasurfaces. The major steps in their development are presented in an historical perspective, showing that those components have made their way over the years from the microwave domain down to the visible. Recent work highlights the possible role of local resonance effects to reach the minimal possible thickness. In this contribution, we concentrate on the benefit of using low absorption index dielectric materials with the highest possible refractive index to maximize diffraction efficiency while keeping the thickness smaller than the vacuum wavelength, and discuss their design. In those nanostructured components, the effective index involves light being locally guided in the nanostructures. To achieve a high efficiency at large numerical apertures, and therefore at large deflection angles near the pupil edge, fine tuning at design stage is required to mitigate fine sampling for wavefront shape fidelity against independent guiding in neighboring structures.