Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:18:9

Or have you thought that the companions of the cave and the inscription were, among Our signs, a wonder?  

Or did you think, did you suppose, that the Companions of the Cave, the cavern in the mountain, and the Inscription, the tablet wherein their names and lineages had been inscribed — the Prophet (s) had been asked about their tale — were, with regard to their tale, a ˹unique˺ marvel from among, the entirety ˹of˺, Our signs? (‘ajaban, ‘a marvel’ is the predicate of ˹the defective verb˺ kāna ˹sc. kānū˺, the preceding ˹min āyātinā, ‘from among Our signs’˺ being a circumstantial qualifier). In other words, ˹did you suppose˺ that they were a marvel exclusively from among all ˹Our˺ other signs, or that they were the most marvellous among them? Not so.
القرآن:١٨:٩

أَمْ حَسِبْتَ أَنَّ أَصْحَابَ الْكَهْفِ وَالرَّقِيمِ كَانُوا مِنْ آيَاتِنَا عَجَبًا  

{أم حسبت} أي ظننت {أن أصحاب الكهف} الغار في الجبل {والرقيم} اللوح المكتوب فيه أسماؤهم وأنسابهم وقد سئل ﷺ عن قصتهم {كانوا} في قصتهم {من} جملة {آياتنا عجبا} خبر كان وما قبله حال، أي كانوا عجبا دون باقي الآيات أو أعجبها ليس الأمر كذلك.