From the Super Mario Wiki
Flip-Swap Platforms are platforms that are found in Super Mario Galaxy 2, Super Mario 3D Land and Super Mario 3D World. They are flat metallic tiles suspended in midair, colored red on one side and blue on the other side, that flip over if a certain command is performed.
In Super Mario Galaxy 2, when Mario performs a spin move, the platforms will flip over, causing the red platforms to show while the blue ones are hidden, or vice versa. Flip-Swap Platforms appear as the primary stage element of the Flip-Swap Galaxy, though minor sections of the same platforms also make an appearance in various parts of the Chompworks Galaxy and the Grandmaster Galaxy as well. In order to successfully make his way through the areas in which these platforms are present, Mario must skillfully spin to make them flip at exactly the right moment. Otherwise, he will fall into open space and lose a life.
These platforms return in Super Mario 3D Land, where they function the same as the previous game. They are now activated simply by jumping, making the player plan their jumps in order to avoid falling down a bottomless pit.
Flip-Swap Platforms also appear in Super Mario 3D World. Here, the panels are noticeably larger, and are again activated by jumps. They can not be flipped using Rosalina's spin attack unlike in Super Mario Galaxy 2 however.