The forms of Ar-Riya
The deed of Riya consists of two forms. One of which will make the person a disbeliever. It is important for Muslims to guard against this deed.
Shaytan always tries to spark something in the hearts of Muslims to make them focus on what others perceive of them. This can result to the Muslim wanting to be praised by others for his or her deeds.
1. Minor Riya
The minor form of Riya does not constitute to a Muslim becoming a disbeliever. It is still a big sin in Islam. This deed can cause the Muslim to go to hellfire if Allah does not want to forgive on Day of Judgement.
All of the rewards that an act of worship brings with it will be nullified when a person does it to be praised. It falls under the act of minor Shirk to perform Riya.
The Prophet (ﷺ) said:
"Verily, my greatest fear for you is the lesser form of idolatry." They said: "What is lesser idolatry, O Messenger of Allah?" The Prophet said, "It is boasting in worship. Allah Almighty will say to them on the Day of Resurrection, when people are rewarded for their deeds: Go to those for whom you wished to be praised in the world and see if you finds reward in them.”
(Musnad Ahmad hadith 23119)
The pious predecessors were strict about doing good deeds in private. They did not want to expose their deeds to the minor or major form of hypocrisy. Because of this, she protected their good deeds in order to preserve the hasanaat.
'Abdullah ibn 'Umar radiyAllahu 'anhu said:
"Whoever tries to make people hear about his deeds will be exposed by some people who have been informed by Allah. ('Abdullah ibn 'Umar then began to cry)"
(Al-Zuhd #308 by Waki' bin Al-Jarrah)
2. Major Riya
It is a big sin to perform acts of worship solely for others to praise you. That is considered the major form of hypocrisy in Islam. One becomes a disbeliever by performing major Riya. It falls under major Shirk (worshiping others besides Allah).
When a person solely wants to be praised by others for performing acts of worship, then he finds their opinion more important then that of Allah. For they pray to be seen by others, talk good to be seen by others and live their life for others.
Allāh has promised the hypocrite men and hypocrite women and the disbelievers the fire of Hell, wherein they will abide eternally. It is sufficient for them. And Allāh has cursed them, and for them is an enduring punishment.
[Surah Tawbah, 68]
Indeed, the hypocrites will be in the lowest depths of Hellfire - and never will you find for them a helper -
[Surah An-Nisaa, 145]