Thumbnail image of graphical abstract

Gratings with switchable diffraction efficiency are produced by soft molding of polymer substrates that contain photochromic molecules. The switching is attributed to the variation in the dimensions of the gratings that result from photoinduced isomerization of the photochromic molecules. UV irradiation results in a decrease in the size of the striped domains, which leads to an increase in diffraction efficiency. Further irradiation with visible light leads to the recovery of the original domain widths and, therefore, the diffraction efficiency decreases to a value close to those measured initially.