Covalent-organic frameworks (COFs) are intriguing platforms for the molecular design of porous skeletons with special functionality. We predict a novel class of narrow bandgap COFs, i.e., (X4Y)(O2B-C12H6-BO2)3, (X = C/Si; Y = C-Pb), featuring strong visible and infrared optical activity. The small band gaps are due strong π-conjugation in the organic linker. Density functional theory calculations demonstrate that the band gap is almost constant at 0.7 eV for whole series of materials. The corresponding threshold adsorption wavelength varies from 1600 to 1700 nm in the near infrared region. The estimated bulk moduli range from 18.0 to 22.6 GPa, significantly larger than that of MOF-5 (ca. 15.4 GPa). This indicates high mechanical stability of the frameworks. Large negative values of formation enthalpy (-20 to -52 kJ mol-1) show high thermodynamic stability. We also investigate an easier to fabricate metal-organic framework material (Zn4O)(O2B-C12H6-BO2)3 using the same linkers, which also shows interesting narrow bandgap behavior. These novel IR-active materials may have potential applications in organic light-emitting devices, chemical and biological sensing, hybrid solar cells, or electroluminescence.