Fresh fruit and vegetables usually suffer from quality deterioration when exposed to inappropriate temperatures. Common energy-input temperature regulation is widely applied but there remain challenges of increasing energy consumption. Passive temperature management regulates the heat transfer without energy consumption, showing a sustainable strategy for food preservation. Here, thermoresponsive hydrogels were constructed by incorporating NaCl and sodium dodecyl sulfate (SDS) micelles into a poly(N-isopropylacrylamide-co-acrylamide) (P(NIPAM-co-AM)) network. Due to the excellent mechanical properties and reversible thermochromism at 14 °C and 37 °C, Gel-8 wt%-NaCl could inhibit temperature rise and avoid sunburn damage to peppers under direct sunlight by blocking the input of solar energy and accelerating moisture evaporation. Additionally, hydrogels could act as a feasible sensor by providing real-time visual warnings for inappropriate temperatures during banana storage. Based on the self-adaptive thermoresponsive behaviour, the prepared hydrogels showed effective performance of temperature regulation and quality preservation of fruit and vegetables.