Perfect vortex beams are the orbital angular momentum (OAM)-carrying beams with fixed annular intensities, which provide a better source of OAM than traditional Laguerre- Gaussian beams. However, ordinary schemes to obtain the perfect vortex beams are usually bulky and unstable. We demonstrate here a novel generation scheme by designing planar Pancharatnam-Berry (PB) phase elements to replace all the elements required. Different from the conventional approaches based on reflective or refractive elements, PB phase elements can dramatically reduce the occupying volume of system. Moreover, the PB phase element scheme is easily developed to produce the perfect vector beams. Therefore, our scheme may provide prominent vortex and vector sources for integrated optical communication and micromanipulation systems.