Stimulus-responsive materials have promising potential applications like actuators, sensors, and flexible electronics, which are important for realizing multidimensional control and improving atomic utilization in future applications. Here, centimeter-scale cocrystals of azobenzene derivatives with excellent elastic deformation ability were designed and prepared. The obtained crystal exhibited a range of striking behaviors, such as cracking, curling, and jumping upon heating and cooling. The mechanism was investigated through detailed crystallographic analysis, experimental tests, and theoretical calculations. The results show that the π-stacking structure formed along the long axis endows the crystals with the ability to resist external forces through elastic deformation, and the anisotropic expansion and contraction of the lattice in response to temperature changes are the source of a series of thermal abrupt behaviors. Furthermore, the photoresponsive property of 4-((4-(propoxy)phenyl)diazenyl)pyridine (APOC) is inherited in the cocrystal, which could rapidly twist under UV illumination. Further simulation and characterization reveal that the bulk stress tilted to the long axis caused by photoisomerization of the host molecules leads to torsion of the crystal. Finally, we successfully applied the crystal as an optical switch in a circuit, taking advantage of its flexibility and photoresponsive properties.