Light period: Yes. When you're in the water, the blood can't leave your body because of the water pressure. When you get out of the water, the blood will naturally flow out and into your swimsuit (replacing the water in the absorbent part). Blood contains iron and is therefore heavier than water, which is why it settles at the bottom of period swimwear.
If you have a medium to heavy period, Period beachwear is best suited to be used as extra protection in addition to tampons or menstrual cups. In that case, we advise against wearing period beachwear alone while swimming.