The structures of three salts of 3-cyano-4-dicyanomethylene-5-oxo-4,5-dihydro-1H-pyrrol-2-olate with alkali metals (Na, K and Rb) are related to their luminescence properties. The Rb salt, rubidium(I) 3-cyano-4-dicyanomethylene-5-oxo-4,5-dihydro-1H-pyrrol-2-olate, Rb(+).C(8)HN(4)O(2)(-), is isomorphous with the previously reported potassium salt. For the Na compound, sodium(I) 3-cyano-4-dicyanomethylene-5-oxo-4,5-dihydro-1H-pyrrol-2-olate dihydrate, Na(+).C(8)HN(4)O(2)(-).2H(2)O, two independent sodium ions, located on inversion centers, are coordinated by four water molecules each and additionally by two cyano groups for one and two carbonyl groups for the other. The luminescence spectra in solution are unaffected by the nature of the cation but vary strongly with the dielectric constant of the solvent. In the solid state, the emission maxima vary with structural features; the redshift of the maximum luminescence varies inversely with the distance between the stacked anions.