Is it true that in America cops can walk around dressed however they want? Without uniform?

r/

I have seen several times in movies and TV series policemen who are dressed casually. Sometimes with t-shirts, sometimes with jackets etc etc with the badge around the neck. Is it really like this in America or do you actually have to wear a uniform?