Context. Recent observations have resulted in the detection of chemical gradients on ultra-hot gas giants. Notwithstanding their high temperature, chemical reactions in ultra-hot atmospheres may occur in disequilibrium, due to vigorous day-night circulation and intense UV radiation from their stellar hosts. Aims. The goal of this work is to explore whether photochemistry is affecting the composition of ultra-hot giant planets, and if it can introduce horizontal chemical gradients. In particular, we focus on hydrogen cyanide (HCN) on WASP-76 b, as it is a photochemically active molecule with a reported detection on only one side of this planet. Methods. We used a pseudo-2D chemical kinetics code to model the chemical composition of WASP-76 b along its equator. Our approach improved on chemical equilibrium models by computing vertical mixing, horizontal advection, and photochemistry. Results. We find that the production of HCN is initiated through the thermal and photochemical dissociation of CO and N2 on the day side of WASP-76 b. The resulting radicals are subsequently transported to the night side via the equatorial jet stream, where they recombine into different molecules. This process results in an HCN gradient with a maximal abundance on the planet’s morning limb. We verified that photochemical dissociation is a necessary condition for this mechanism, as thermal dissociation alone proves insufficient. Other species produced via night-side disequilibrium chemistry are SO2 and S2. Conclusions. Our model acts as a proof of concept for chemical gradients on ultra-hot exoplanets. We demonstrate that even ultra-hot planets can exhibit disequilibrium chemistry and recommend that future studies do not neglect photochemistry in their analyses of ultra-hot planets.