The ability of a carboxylic acid functionalized spiropyran, SP, to act as a reversible and selective receptor for metal ions has been systematically examined. A series of spectroscopic measurements, combined with single-crystal X-ray diffraction have been employed in order to determine metal-ion sensitivity and selectivity, binding constants, solution compositions, binding kinetics as well as solid-state structure of a metal-complex of this ligand. This molecule acts as a chelating ligand and binds to metal ions using a triad of functionalities and will release the metal ion by application of visible light. Altering the complex from ZnCl2 and Zn(ClO4)2, leads to only a small change in the complex absorption maxima from 494 to 492 nm, but produced a drastic increase in the sensitivity for the zinc(ii) ion. Fluorescence spectroscopy was employed to establish that the detection limit for Zn(ii) is approximately 3 × 10-7 M for Zn(ClO 4)2. The counterion also influences binding constants and the equilibrium constants for Cu(ClO4)2 and CuCl 2 are K = 3.37 × 104 M-1 to K = 2.04 × 103 M-1, respectively. Additionally, in the presence of perchlorate, the spiropyran-Cu complex formation is fast enough to allow for real-time naked eye detection of this metal ion in less than three minutes; the formation of other metal complexes takes between 50 minutes to 2 hours. Finally, the single-crystal structure determination of the SP-zinc chloride complex shows that the Zn(ii) ion displays a distorted square-pyramidal arrangement, and neighbouring metal ions are bound together into a 1-D coordination polymer with a hydrophilic core, surrounded by hydrophobic ‘cladding’. © 2010 The Royal Society of Chemistry.