An undulator composed of an electromagnet (EM) and a permanent magnet (PM) has been developed to switch rapidly the right- or left-circularly polarized radiation. The polarization switching is achieved using the rapid change of polarity of excitation currents in the EM, which provides a vertical field in a fixed gap. A horizontal field is generated with a PM; the field strength is adjusted on altering its horizontal gaps. In addition to circularly polarized radiation, the structure fulfills the needs of horizontal and vertical linear polarization. In this paper, we discuss the compact structure and show a design to provide soft X-rays for TPS. The design considerations for this magnet include the design concept, magnetic materials, mechanical and coil structure, all of which are discussed in this paper.