Hadith 1621
Abu Dharr (May Allah be pleased with him) said:
وعن أبي ذر رضي الله عنه قال: قيل لرسول الله صلى الله عليه وسلم : أرأيت الرجل يعمل العمل من الخير، ويحمده الناس عليه؟ قال: " تلك عاجل بشرى المؤمن" ((رواه مسلم)).
The Messenger of Allah (ﷺ) was asked: "Tell us about a person who does some good deed and people praise him, will this be considered as showing off?" He replied, "This is the glad tidings which a believer receives (in this life)." [Muslim].
In plain words
When someone does a good deed for Allah and people happen to praise him, this is not showing off but a welcome glad tiding for the believer. Praise you did not seek does not spoil a sincere deed.
Reference : Riyad as-Salihin 1621 In-book reference : Book 17, Hadith 111