Each material has an element (Fire, Water, Earth, etc.) indicated by the material's color, and a rarity indicated by the shape of the material.
 
To Enchant a dragon, you need materials with the same elements of the dragon, and various qualities depending on how high the dragon's Enchantment Level is.
 
The higher the dragon's Enchantment Level, the more precious materials you will need.