Given your desire to make it comparatively thin (which is bad for stiffness in general) the best bet would be a Stressed Skin Panel also known as a Torsion Box
Common construction for that as a DIY is two sheets of plywood, (one top, one bottom) and some sort of spacers plus lots of glue. It's an interesting and educational experiment to compare how two sheets of plywood separated by a foam core behave without glue when you stand on them as compared to how they behave when the core is glued in, but for a shelf you don't need foam as a core - wood will do.
What this does (compared to using several joists, unbonded) is to provide a full sheet worth of strength on the tension side of the structure - similar in principle to an I beam, where the sheets of plywood (or OSB, it IS a garage shelf...) act as the tension and compression "flanges" and the wood spacers act as the "web" that holds them apart.
However, it is STILL the case (it is ALWAYS the case...) that additional depth (space between sheets in this case) pays off hugely, because stiffness is related to the cube of the depth of a beam - so a beam twice as thick is 8 times as stiff. Or a beam merely 1.25 times as thick is nearly twice as stiff, and one 1.5 times as thick is more than 3 times as stiff as the original beam.
(A different option in the "buy a solution" direction would be to get prefabricated steel pallet racking, but I assume that if you have already built side supports you are not interested in going that direction.)
If you wish to play with loading options (this is NOT set up for stressed skins, just beams/joists):