Floor panels provided with a mechanical locking system comprising a separate material in order to reduce snapping resistance during vertical displacement. For example, a separate flexible tongue, the flexible tongue including an inner part, which is connected to a holding groove at a second edge, and an outer flexible snap tab that extends upwardly and in the connected state into a cavity under a protruding tongue for locking a first and a second floor panel to each other in a vertical direction.