What Am I?

I’m used to cover things but I’m not a tent
I can be used to block the sun but I’m not sunscreen
I’m made of fabric but I’m not an umbrella
I come in different styles but I’m not a T-shirt
I’m worn on the head but I’m not a pair of sunglasses