Imam Al-Nawawi's Riyad-us-Saliheen
Chapter 232
I`tikaf (Seclusion in the Mosque) in the Month of Ramadan

1268. Ibn `Umar (May Allah be pleased with them) reported: The Messenger of Allah (sallallaahu ’alayhi wa sallam) used to observe I`tikaf in the last ten days of Ramadan.
[Al-Bukhari and Muslim].

1269. `Aishah (May Allah be pleased with her) reported: The Prophet (sallallaahu ’alayhi wa sallam) used to engage himself in I`tikaf (seclusion for prayers) in the mosque during the last ten nights of Ramadan till he passed away; thereafter, his wives followed this practice after him.
[Al-Bukhari and Muslim].

1270. Abu Hurairah (May Allah be pleased with him) reported: The Prophet (sallallaahu ’alayhi wa sallam) used to observe I`tikaf every year (during Ramadan) for ten days; in the year in which he passed away, he observed I`tikaf for twenty days.
[Al-Bukhari].

Commentary:  We learn from these Ahadith that the observance of I`tikaf in the last ten days of Ramadan is Sunnah of the Prophet (sallallaahu ’alayhi wa sallam). But it can be done only in mosque not at home. I`tikaf helps to enhance one's spiritual growth and to strive hard to worship Allah better as there is nothing to distract one's attention from this noble pursuit.