A B12-dependent light-sensing hydrogel has been created by covalently stitching together the photoreceptor C-terminal adenosylcobalamin binding domain (CarHC) proteins under mild conditions. This direct assembly of stimuli-responsive proteins into hydrogels represents a versatile solution for designing “smart” materials and opens up enormous opportunities for future material biology.