In the study, we have developed an efficient and robust method using dual modes of fluorescence sensing and smartphone readout for the detection of pyrethroids using artificial receptors inside a covalent organic framework. Carbazole-conjugated frameworks (CCFs) were used to prepare efficient fluorescent probes that combine stability with light-emitting activity. CN linkages between aldehydes and amines formed Schiff bases, allowing the development of layered structures, creating exceptionally stable frameworks. Artificial receptors that can bind compounds inside the CCFs with high affinity, for both the detection and absorption of λ-cyhalothrin (LC), were constructed using room-temperature reverse microemulsion polymerization. Under optimum conditions, the fluorescence sensing correlation with the concentration of LC showed good linearity in the range of 0.8–175 μg L−1 with a detection limit of 0.368 μg L−1. The smartphone-based visible readout exhibited a good effect, with a detection limit of 4.067 μg L−1, and recovery of 88 %–103% in food samples. A parallel analysis in food samples was conducted by high-performance liquid chromatography, the results showed good consistency, indicating the practicability of the developed method. Dual mode analysis can avoid the disadvantages of a single response, providing excellent sensitivity, specificity, and efficiency through a strong binding force between the target and the artificial receptors.