The pieces would be found in levels, the pieces collected can then be assembled into different spells.
The cost of the spell would be linked to the components attached, with modifiers such as damage, range and number of projectiles getting exponentially more expensive.
The best example for this I know of that has been done before is the spell crafting system in Tyranny.
The player would be able to equip one spell of each element at a time, using num keys or a quick select menu to swap spells.