Grafting natural nicotinamide on tempo-oxidized cellulose nanofibrils to prepare flexible and transparent nanocomposite films with fascinating mechanical strength and UV shielding performance.