In this work, two-dimensional WS 2 –polyacrylamide metal–organic frameworks (MOFs) are prepared via an energy-efficient solvent-free frontal polymerization method and further used as a biocompatible, flexible, low threshold high-performance photodetection.