You can buy hat boxes.
Or if they are special hats display them along a wall.
I would hang them from an over the door hanger or peg rail or keep the nestled inside each other (to keep shape) and stored in a canvas bin in the closet.
I have hooks hanging on the wall in my closet and I hand all my hats from the hooks. They stay nice and I can see each one.