It has its basis in the Qur'an:
⭐ O believers! Obey Allah and obey the Messenger and those in authority among you. Should you disagree on anything, then refer it to Allah and His Messenger, if you ˹truly˺ believe in Allah and the Last Day. This is the best and fairest resolution. (Surah An-Nisa 4:59)
‘You are the best of the people evolved for the mankind enjoining what is right and forbidding what is evil’ (Al Imran 3:110).
It has its basis in the Hadith:
‘My community will never agree upon an error.’
“The hand of Allah is with the congregation (al-jama`a)“
Basis of ijma’ can be found not only in the ahadith but also in the Qur’an:
⭐ O believers! Obey Allah and obey the Messenger and those in authority among you. Should you disagree on anything, then refer it to Allah and His Messenger, if you ˹truly˺ believe in Allah and the Last Day. This is the best and fairest resolution. (Surah An-Nisa 4:59)
‘My community will never agree upon an error’