Metal–organic frameworks (MOFs) are well known for their tunable structure and porosity. Many studies have shown they are promising for various important applications, for which their performance can be further enhanced by encapsulating functional species, such as luminescent guest molecules, within the frameworks. Although numerous MOFs are luminescent, very few emit white light and their quantum yield is usually low. Here we report a strategy to achieve efficient white-light emission by encapsulating an iridium complex in the MOF cavity. A mesoporous blue-emitting MOF is prepared as host to encapsulate a yellow-emitting iridium complex, [Ir(ppy)2(bpy)]+. The resultant composites emit bright white light with good colour quality (for example, Commission International de I’Eclairage coordinates, colour-rendering index and correlated colour temperature of (0.31, 0.33), 84.5 and 5409 K, respectively), and high quantum yield up to 115 °C. This strategy may open new perspectives for developing high-performance energy-saving solid-state lighting materials.