Microfluidic devices allow the manipulation of fluids down to the micrometer scale and are receiving a lot of attention for applications where low volumes and high throughputs are required. In these micro channels, laminar flow usually dominates, which requires long residence times of the fluids, limiting the flow speed and throughput. Here a switchable passive mixer has been developed to control mixing and to easily clean microchannels. The mixer is based on a photoresponsive spiropyran based hydrogel of which the dimensions can be tuned by changing the intensity of the light. The size-tunable gels have been used to fabricate a passive slanted groove mixer that can be switched off by light allowing to change mixing of microfluidics to non-mixed flows. These findings open new possibilities for multi-purpose microfluidic devices where mixers and valves can be tuned by light. (Figure presented.).