In this study, the electrospun cellulose acetate (CA) nanofibrous films were hydrolyzed and then dyed with a synthetic dye of 1-hydroxy-4-[4-(ethylsulfurate sulfonyl)-phenylazo]-naphthalene (HESPN). The physicochemical properties of the dyed films were similar to the unmodified films. Due to the covalent bonds formed between dye and cellulose molecules, the dyed films showed high stability with almost no dye leakage in acidic solutions and minimal leakage (0.4 %) in alkaline solutions. In addition, the dyed films exhibited rapid responsiveness to ammonia gas and could transit from yellow to brown within 20 s due to the nanofibrous structure of the films and quick color change of the dye. The dyed films can be used to monitor the spoilage of shrimp with a color change from yellow to brown. The nanofibrous cellulose films dyed with HESPN can be potentially applied as indicators to be used in smart packaging.