Are material components always consumed upon casting?

If invisibile, whats the rules for melee targeting & spells?