What is the legal basis for Eid prayer?
Chapter on the Two Eid Prayers
Al-Mughni
Book of Friday Prayer
Primary text
The basis for Eid prayer is established by the Quran, the Sunnah, and the consensus (Ijma) of the Muslims. The Quranic evidence is found in the verse: "So perform prayer for your Lord and sacrifice" (Quran 108:2), which is interpreted by the majority to refer to the Eid prayer. The Sunnah is established by the constant practice of the Prophet, peace be upon him, praying both Eids, and specifically that he prayed both Eids before the sermon. Furthermore, it is established by continuous tradition that the Prophet, peace be upon him, prayed Eid without an Adhan or Iqamah. Muslims are unanimously agreed upon the validity of the two Eid prayers.
Supporting text
The dominant view within the Madhhab states that Eid prayer is a Fard Kifayah (communal obligation); if enough people perform it, the obligation is lifted from the rest. If the entire populace of a town agrees to abandon it, the Imam is obligated to fight them. Some Shafi'i scholars align with this view.