3D spongy-like porous carbon materials derived from eggplants were used as scaffolds for encapsulating polyethylene glycol (PEG) to fabricate shape-stabilized composite phase-change materials with excellent solar-to-thermal conversion efficiency.