AbstractMaterials are said to show a shape-memory effect if they can be deformed and fixed into a temporary shape, and recover their original, permanent shape only on exposure to an external stimulus1, 2, 3. Shape-memory polymers have received increasing attention because of their scientific and technological significance4, 5. In principle, a thermally induced shape-memory effect can be activated by an increase in temperature (also obtained by heating on exposure to an electrical current6 or light illumination6, 7). Several papers have described light-induced changes in the shape of polymers8, 9, 10, 11, 12 and gels13, 14, 15, such as contraction8, 9, 10, bending11, 12, 13 or volume changes14, 15. Here we report that polymers containing cinnamic groups can be deformed and fixed into pre-determined shapes—such as (but not exclusively) elongated films and tubes, arches or spirals—by ultraviolet light illumination. These new shapes are stable for long time periods, even when heated to 50 °C, and they can recover their original shape at ambient temperatures when exposed to ultraviolet light of a different wavelength. The ability of polymers to form different pre-determined temporary shapes and subsequently recover their original shape at ambient temperatures by remote light activation could lead to a variety of potential medical and other applications.