Photo-control over supramolecular sol–gel conversion is achieved by incorporating photoactive coumarin moieties into a tribranched monomer and the self-assembly with γ-CD followed by noncovalent–covalent switchover.