With the extensive use of palladium derivatives in the industry, their environmental pollution has become more and more serious. Herein, allyl functionalized hydrazone 2D COFs (XB-COFs) were found for selective fluorescent detection of Pd 2+ (detection concentration of 0.29 μM) in water. The stable structure of the hydrazone bond and the complexation ability of allyl to Pd 2+ cause XB-COF to have a good fluorescence sensing effect in both acid and alkaline solutions, and its adsorption capacity for Pd 2+ is up to 120 mg g −1 .During the interaction between XB-COF and Pd 2+ , a part of Pd 2+ can be reduced to Pd nanoparticles with a diameter of about 10 nm. A fluorescent test paper was prepared by the in situ growth of XB-COF onto a filter paper, which can realize visualization detection of Pd 2+ in 10 s with the naked eye or under a 365 nm UV lamp. This is the first time a fluorescent test paper based on in the situ growth of COFs has been applied for the detection of heavy metal ions, which provides a new platform for the application of COF materials in the medical health field, food safety, and environmental protection.