Abrupt modifications of the fields across an interface can be engineered by depositing an array of sub-wavelength resonators specifically tailored to address local amplitude, phase and polarization changes. Physically, ultrathin nanostructure arrays (δ≪λ), also called ‘‘optical metasurfaces’’, control light by engineering artificial boundary conditions of Maxwell’s equations. Metasurfaces have been implemented to obtain various sorts of optical functionalities, ranging from the basic control of the transmission and reflection of light, to the control of the radiation patterns for comprehensive wavefront engineering and holography. In this presentation, we will discuss recent works on free standing visible (GaN based) and mid-infrared (Si-based) metasurfaces. We will explain which physical mechanisms are utilized for the design of efficient ultrathin planar optical components and show that these conditions are connected with the well-known Kerker conditions already proposed for isolated scatterers. Similar principles can be used to design various other optical metasurfaces, e.g. flat lenses, phase plates, waveplates, helical wavefront generators, and holograms. Rectangular, elliptical, or other asymmetrical hole shapes can be used to impart birefringence to different light polarisations, as required in waveplates or polarisation beam splitters. We will conclude our presentation with a discussion on the concept of conformal boundary optics: an analytical method based on novel, first-principle derivations that allows us to engineer transmission and reflection at will for any interface geometry and any given incident wave.