“I attended the ‘Eid
prayer with the Messenger of Allah (ﷺ). He led us in offering the
‘Eid prayer, then he said: ‘I have finished the prayer. Whoever
wants
to sit (and listen to) the sermon, then let him sit, and
whoever wants
to leave, then let him leave.’”
Sunan Ibn Majah Book 5, Hadith 488