An ionic bond involves a metal that shares electrons with a nonmetal. This type of bond is formed when one atom transfers one or more electrons to another atom. The metal atom loses electrons to become a positively charged ion, while the nonmetal atom gains those electrons to become a negatively charged ion. The electrostatic attraction between these oppositely charged ions forms the ionic bond.
For example, in sodium chloride (NaCl), sodium (a metal) donates an electron to chlorine (a nonmetal), resulting in the formation of Na+ and Cl- ions. These ions are held together by the strong electrostatic forces of attraction, creating the ionic bond.