It is mustaḥab (recommended) to congratulate the parent of a new born baby as mentioned by Imam Nawawī (d. 676/1277) in al-Adhkār (p. 289) and Ḥāfiẓ Ibn al-Qayyim (d. 751/1350) in Tuḥfat al-Mawdūd (p. 27). It is mentioned in authentic narrations that the Prophet ﷺ would supplicate and seek blessings for the new born baby. For example, when ʿAbd Allah ibn al-Zubayr (d. 73/692) (may Allah be pleased with him) was born, the Prophet ﷺ supplicated and sought blessings for him (Ṣaḥīḥ al-Bukhārī, 3909). Similarly, when Abū Mūsā al-Ashʿarī (d. 44/665) (may Allah be pleased with him) had a baby, the Prophet ﷺ supplicated for blessings for him (Ṣaḥīḥ al-Bukhārī, 5467).
Several supplications are found in the books of ḥadīth:
(1) The most authentic supplication has been transmitted in Musnad al-Bazzār (7310):
بَارَكَ اللهُ لَك فِيْهِ وَجَعَلَهُ بَرًّا تَقِيًّا
“May Allah instil blessings in him for you and make him righteous God fearing.”
All the transmitters of this chain are thiqah (trustworthy) as affirmed by Ḥāfiẓ Haythamī (d. 807/1405) in Majmaʿ al-Zawāʾid (9: 261). It is also worth noting that this narration is marfūʿ (attributed to the Prophet ﷺ), unlike the two narrations below.
(2) There is another supplication narrated from some tābiʿūn (followers of companions):
جَعَلَهُ اللهُ مُبَارَكًا عَلَيْكَ وَعَلَى أمَّةِ مُحَمَّدٍ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ
“May Allah make him blessed for you and for the nation of Muḥammad ﷺ.”
This supplication has been transmitted from Ayyūb al-Sakhtiyānī (d. 131/748-9) in al-Nafaqah alā al-ʿIyāl (202), al-Duʿāʾ (946) and Hilyat al-Awliyāʾ (3: . The same supplication has also been narrated from Ḥasan al-Baṣrī (d. 110/728) in al-Duʿāʾ (945). Both narrations are ḥasan (agreeable).
(3) A third supplication has been transmitted from Ḥasan al-Baṣrī (d. 110/728):
شَكَرْتَ الْوَاهِبَ وَبُوْرِكَ لَكَ فِي الْمَوْهُوْبِ وَبَلَغَ أَشُدَّهُ وَرُزِقْتَ بِرَّهُ
“May you thank The Giver, may you be blessed in the gift, may the child reach the maturity of years, and may you be granted its righteousness.”
This narration from Ḥasan al-Baṣrī has been transmitted in Musnad ʿAlī ibn al-Jaʿd (3398) and via it in al-Nafaqah alā al-ʿIyāl (201) and al-Kāmil (8: 395). However, this narration is extremely weak because of Haytham ibn Jammāz, a repudiated transmitter (al-Kāmil, 8: 395; Mīzān al-Iʿtidāl, 4: 319; Lisān al-Mīzān, 8: 352). The narration has also been transmitted in Tārīkh Dimashq (59: 276) via another chain with a slight variation in the order of the phrases. However, the narration is also weak due to Kulthūm ibn Jawshan, a weak transmitter (al-Jarḥ wa al-Taʿdīl, 7: 164; Tadhkirat al-Ḥuffāz li Ibn al-Qaysarānī, p. 412; Tahdhīb al-Kamāl, 24: 201).
Nevertheless, scholars who have cited this supplication include Imam Ibn Qudāmah (d. 620/1223) in al-Mugnī (9: 464) and Ḥāfiẓ Ibn al-Qayyim (d. 751/1350) in Tuḥfat al-Mawdūd (p. 29). Imam Nawawī (d. 676/1277) also cites this supplication in al-Adhkār (p. 289) with a slight variation in the wording and adds the following based on the Prophetic advice to return a favour (Sunan al-Tirmidhī, 2035; Ṣaḥīḥ Ibn Ḥibbān, 3413):
ويستحب أن يرد على المهنئ فيقول: بارك الله لك وبارك عليك، أو جزاك الله خيرا ورزقك مثله، أو أجزل ثوابك، ونحو هذا
“And it is recommended [for the parent] to reply to the person congratulating and say: May Allah bless you, and shower His blessings upon you, or [say:] may Allah reward you well and grant you its like, or [say:] may he reward you abundantly, and similar to this.”
In conclusion, it is desirable to congratulate the parents of a new born baby and seek Allah’s blessings for the child. It is preferable to use the first supplication cited above. However, this is not necessary and one will be rewarded for invoking blessings through the other two phrases or indeed any other similar phrase.