There is no harm in writing fiction, whether it be stories or poetry, as long as they are written for a good purpose or to expose and overcome evil.
Sheikh Muhammad Al-Mukhtar Al-Shinqiti, Director of the Islamic Center of South Plains, Lubbock, Texas, states: “Literary speaking, one must have an extraordinary imagination to write fictional stories about the Jinn. In Islam there is no harm in writing about this subject unless the stories contain something that contradicts Islamic belief. It is advised to read what the Qur’an says about the Jinn, and to start writing with the story of the Jinn who came to the Prophet (peace and blessings be upon him), listened to his recitation of the Qur’an, and accepted Islam. There are references to this story in surat Al-Jinn (chapter 72) and surat Al-Ahqaf (chapter 46). One can also find further details of this story in the books of sirah (the Prophet’s Biography), especially accounts narrating the journey of the Prophet to At-Ta’if.”