A FRET-based upconversion nanoprobe assembled with an electrochromic chromophore for sensitive detection of hydrogen sulfide in vitro and in vivo.