A unique, selective, and sensitive colorimetric nanosensor for the naked-eye detection and adsorption of Pb(II) and Cd(II) in aqueous media has been synthesized based on the organic–inorganic hybrid. Acrylamide (AM) and 2-acrylamido-2-methylpropanesulfonic acid (AMPS) as hydrophilic monomers, functionalized β-cyclodextrin (f-β-CD) as host-guest complex formation agent, and vinyl-dithizone (f-DTZ) as an efficient ligand were used. The β-CD with a hydrophobic interior and hydrophilic exterior can form a host-guest inclusion complex with a ligand that enhances nanosensors’ dispersion in aqueous media. The immediate color change of the sensor has been observed from gray to pink and blue for Pb(II) and Cd(II) with a wide linear range of [(1 ppb- 40 ppb)] and [(1 ppb- 60 ppb)], respectively. This study also considered the adsorption qualities of these heavy metals under various factors, including pH, time length, and initial ion concentration. The maximum adsorption capacity of Cd(II) via polymeric nanocomposite was 166 mg·g−1 at optimum condition. The experimental info has been investigated using the Langmuir and Freundlich isotherms and the pseudo-first-order and pseudo-second-order kinetic models.