Ostentation (showing off) in worship is Haram
It is proven from definitive texts that sincerity (Ikhlas) is Wajib in worship and ostentation (Riya) and showing off is Haram. Having the intention of seeking Allah's pleasure in one's worship is Ikhlas, and having the intention of anything else is Riya. The Prophet ﷺ has called Riya the minor shirk (Shirk-e-Asghar). If a person performs prayer thinking what people will say if they see him abandoning the prayer, or if a student performs prayer out of fear of punishment for skipping prayer, then this is also included in Riya. The prayer performed in this manner will be valid but will be devoid of reward, because validity does not necessitate reward, nor does reward necessitate validity; validity is related to conditions and pillars, and reward is related to sincerity. Therefore, whenever any worship is performed, it should be done with sincerity so that it becomes valid as well and reward is also gained in the Hereafter, and this is the very purpose of worship. (Aham Masail/Vol:2/Pg:207)