Bandgap engineering of semiconductor nanowires or nanoribbons (NRs) offers a promising material foundation for multifunctional integrated optoelectronic devices and circuits. Among these materials, all-inorganic halide perovskites have emerged as a leading candidate for next-generation photoelectronic applications due to their outstanding optoelectronic properties. In this work, we report the direct synthesis of high-quality bandgap gradient lead halide perovskite (CsPbCl3(1-x)Br3x and CsPbBr3(1-x)I3x (X = 0-1) NRs using a magnetic-pulling source-moving chemical-vapor-deposition (CVD) method. Microstructural characterizations reveal that these as-grown NRs possess high-quality single crystalline structures with continuously tunable compositions. The photoluminescence emissions of these perovskite NRs can be finely tuned across the entire visible spectrum (417-702 nm). Furthermore, photodetectors based on these perovskite NRs demonstrate exceptional photoelectric performance, including a high ION/IOFF ratio (104), superior responsivity (37.5 A/W), and remarkable detectivity (2.81×1013 Jones). A spatially resolved imaging sensor based on these perovskite NRs is also demonstrated, indicating promising applications in photoelectronic imaging circuits. These bandgap-tunable perovskite NRs provide a versatile materials platform for future integrated devices in electronics and optoelectronics.