What is the ruling on leaving righteous actions due to the fear of showing off?

Shaykh Zayd al-Madkhalī:

This is not permissible. This is from the trickery of the Shayṭān in the minds of the believers – meaning he deprives him from the reward of righteous actions. So put your trust in Allāh and make your intention sincerely for Allāh and act [righteously] inwardly and outwardly.

Every time you have the opportunity then act and ask Allāh for two things;

  • He makes your action a righteous one.
  • He makes it sincerely for His Noble Face.

Supplicate and nothing will harm you. Likewise, after that the narrated supplication should not be forgotten by the Muslims,

‘O’ Allah, I seek refuge in you least I associate partners with you whilst knowing and I ask your forgiveness for that which you know.’

This removes the whispers [from the Shayṭān].

So Allāh’s help is sought in increasing the performance of the righteous deeds and the removal of those whispers which is a way to deprive the slave from carrying out righteous deeds.