ionic compounds are held together by ionic bonds are formed by the transfer of electrons from a metal to a non metal
Ionic bond is formed by the electrostatic attraction between the oppositely charged ions.
metals give out electrons and becomes positively charged. positively charged ions are called cations. so these are called metal cations
the electrons given out are taken in by non metals and become negatively charged. negatively charged ions are called anions. then they are called non metal anions.
so ionic compounds are formed by the electrostatic attraction between metal cations and non metal anions.
therefore ionic compounds are composed of a metal cation and a nonmetal anion