The ideal material for nanophotonic applications will have a large refractive index at optical frequencies, respond to both the electric and magnetic fields of light, support large optical chirality and anisotropy, confine and guide light at the nanoscale, and be able to modify the phase and amplitude of incoming radiation in a fraction of a wavelength. Artificial electromagnetic media, or metamaterials, based on metallic or polar dielectric nanostructures can provide many of these properties by coupling light to free electrons (plasmons) or phonons (phonon polaritons), respectively, but at the inevitable cost of significant energy dissipation and reduced device efficiency. Recently, however, there has been a shift in the approach to nanophotonics. Low-loss electromagnetic responses covering all four quadrants of possible permittivities and permeabilities have been achieved using completely transparent and high-refractive-index dielectric building blocks. Moreover, an emerging class of all-dielectric metamaterials consisting of anisotropic crystals has been shown to support large refractive index contrast between orthogonal polarizations of light. These advances have revived the exciting prospect of integrating exotic electromagnetic effects in practical photonic devices, to achieve, for example, ultrathin and efficient optical elements, and realize the long-standing goal of subdiffraction confinement and guiding of light without metals. In this Review, we present a broad outline of the whole range of electromagnetic effects observed using all-dielectric metamaterials: high-refractive-index nanoresonators, metasurfaces, zero-index metamaterials and anisotropic metamaterials. Finally, we discuss current challenges and future goals for the field at the intersection with quantum, thermal and silicon photonics, as well as biomimetic metasurfaces.