The vitreous humor of the eye is a biological hydrogel principally composed of collagen fibers interspersed with hyaluronic acid. Certain pathological conditions necessitate its removal and replacement. Current substitutes, like silicone oils and perfluorocarbons, are not biomimetic and have known complications. In this study, we have developed an in situ forming two-component biomimetic hydrogel with tunable mechanical and osmotic properties. The components are gellan, an analogue of collagen, and poly(methacrylamide-co-methacrylate), an analogue of hyaluronic acid; both endowed with thiol side groups. We used response surface methodology to consider seventeen possible hydrogels to determine how each component affects the optical, mechanical, sol-gel transition temperature and swelling properties. The optical and physical properties of the hydrogels were similar to vitreous. The shear storage moduli ranged from 3 to 358 Pa at 1Hz and sol-gel transition temperatures from 35.5 to 43 °C. The hydrogel had the ability to remain swollen without degradation for four weeks in vitro. Three hydrogels were tested for biocompatibility on primary porcine retinal pigment epithelial cells, human retinal pigment epithelial cells, and fibroblast (3T3/NIH) cells, by electric cell-substrate impedance sensing system. The two-component hydrogels allowed for the tuning and optimizing of mechanical, swelling, and transition temperature to obtain three biocompatible hydrogels with properties similar to vitreous. Future studies include testing of the optimized hydrogels in animal models for use as a long-term substitute, whose preliminary results are mentioned.