The Nayanars (or Nayanmars; நாயன்மார், and later 'teachers of Shiva ) were a group of 63 Tamil Hindu saints living during the 6th to 8th centuries CE who were devoted to the Hindu god Shiva. Along with the Alvars, their contemporaries who were devoted to Vishnu, they influenced the Bhakti movement in early medieval South India. The names of the Nayanars were first compiled by Sundarar. The list was expanded by Nambiyandar Nambi during his compilation of material by the poets for the Tirumurai collection, and would include Sundarar himself and Sundarar's parents.
The Nalvar (The Four) are the four foremost Nayanars Appar, Sundarar, Sambandar and Manikkavaasagar.
The list of the Nayanars was initially compiled by Sundarar (Sundararmurthi). In his poem Tiruthonda Thogai he sings, in eleven verses, the names of the Nayanar saints up to Karaikkal Ammaiyar, and refers to himself as "the servant of servants". The list did not go into the detail of the lives of the saints, which were described in detail in works such as Tevaram.
In the 10th century, king Raja Raja Chola I collected the volumes of Tevaram after hearing excerpts of the hymns in his court. His priest Nambiyandar Nambi began compiling the hymns into a series of volumes called the Tirumurai. He arranged the hymns of three saint poets Sambandar, Appar and Sundarar as the first seven books which he called the Tevaram. He compiled Manikkavasakar's Tirukovayar and Tiruvasakam as the eighth book, the 28 hymns of nine other saints as the ninth book, the Tirumandiram of Tirumular and 40 hymns by 12 other poets as the tenth book. In the eleventh book, he created the Tirutontanar Tiruvanthathi (also known as Tirutoṇṭar Antādi, lit. Necklace of Verses on the Lord's Servants), which consisted of 89 verses, with a verse devoted to each of the saints. With the addition of Sundarar and his parents to the sequence, this became the canonical list of the 63 saints. In the 12th century, Sekkizhar added a twelfth volume to the Tirumurai called Periya Puranam in which he expands further on the stories of each of 63 Nayanars.