Generalized pagination widget