The neutron capture reaction is investigated. The three major reaction mechanisms, namely, compound-nucleus capture (CNC), pre-equilibrium capture (PEC), and direct capture (DIC), are considered on the basis of the Hauser-Feshbach model, the exciton model, and potential model, respectively. The three mechanisms are treated simultaneously and consistently, i.e, they are obtained on the basis of the same nuclear ingredients, such as the optical potential and nuclear-level densities. In this framework, the three components are calculated on the same footing and represent partial fluxes of the same total reaction cross section. The total neutron-capture cross sections and astrophysical reaction rates are calculated within the updated modern reaction code TALYS for about 8000 nuclei with 8 Z 110 lying between the proton and neutron drip lines. The nuclear-structure ingredients involved in the calculation are determined from experimental data whenever available and, if not, from global microscopic nuclear models. For the targets with mass number A > 26, a fair agreement between the computed total-capture cross sections and experimental data is found but, for the lightest nuclei, only the predicted DIC cross sections reproduce the experimental results satisfactorily. Significant and even dominant contribution to the total reaction rate comes from the DIC component for neutron-rich nuclei, especially in the Z = 50-70 region. The impact of the newly determined reaction rates on the r process abundances resulting from the ejection of matter in neutrino-driven winds or the decompression of neutron star matter is investigated.