A 1,8-dioxapyrene-based electrofluorochromic supramolecular polymer was constructed through the coordination of terpyridine ligands with Eu3+ ions. The polymer can be used in anti-counterfeiting inks.