New methodology for making novel materials is highly desirable. Here, an "ingredients" approach to functional self-assembled hydrogels was developed. By designing a building block to contain the right ingredients, a multi-responsive, self-assembled hydrogel was obtained through a process of template-induced self-synthesis in a dynamic combinatorial library. The system can be switched between gel and solution by light, redox reactions, pH, temperature, mechanical energy and sequestration or addition of Mg(II) salt.