Flexible grid system

I want to create grided frame with this effect, like clicked thigg by s are smoothly going ibto their place, not immediately

use a script to create a grid layout and then move the items in the grid with tweens