Photoresponsive shape memory nanoparticles have a layered smectic ordering and include a photoresponsive moiety selected from the group consisting of azobenzene, stilbene, and spiropyran. Multiple cycles of contraction and extension in these materials can be controlled by UV and visible light. By changing light intensity and exposure time, the magnitude of actuation can be modulated.