The concept of isogeometric analysis (IGA) was first applied to the approximation of Maxwell equations in [A. Buffa, G. Sangalli, and R. Vázquez, Comput. Methods Appl. Mech. Engrg., 199 (2010), pp. 1143-1152]. The method is based on the construction of suitable B-spline spaces such that they verify a De Rham diagram. Its main advantages are that the geometry is described exactly with few elements, and the computed solutions are smoother than those provided by finite elements. In this paper we develop the theoretical background to the approximation of vector fields in IGA. The key point of our analysis is the definition of suitable projectors that render the diagram commutative. The theory is then applied to the numerical approximation of Maxwell source problems and eigenproblems, and numerical results showing the good behavior of the scheme are also presented. Copyright © 2011 Society for Industrial and Applied Mathematics.