I probably don’t have the scale of storage problem that you do, but I use clear plastic jars to store the smaller screws, specifically the jars that Vita brand pickled herring are sold in.
The jars are about 3"x4", big enough for small screws. They are wide-mouthed and transparent, as you can see. They are also shatterproof. The lids offer plenty of space for labeling. And as it happens, the Vita labels are just glued at the ends, not over their entire length, so they are easily torn off.
I put the jars in snall boxes from Amazon, label the sides of the boxes more generally (like “Screws”) and put the boxes on shelves. Remarkably efficient, and very cheap. (You still have to buy and probably eat the pickled herring.)
I haven’t had to store large numbers of longer screws or nails, but I’d probably use the boxes they came in.