We present a new approach for the prompt production of quarkonia which is based on the $k_T$-factorization method. The production of even C-parity quarkonia proceeds via the fusion of two (off-shell) gluons. Especially in the kinematics of the LHCb experiment these processes are thus expected to be a sensitive probe of the small-$x$ gluon distribution. We calculate the relevant off-shell matrix elements in terms of the light-front wave functions of the quarkonium states. We present our results for scalar and pseudoscalar charmonia and discuss photon transition form factors as well as cross sections for prompt hadroproduction. We compare our results for the $eta_c$ to recent LHCb data.