In Dzogchen, rainbow body is a level of realization. This may or may not be accompanied by the 'rainbow body phenomenon'. The rainbow body phenomenon is a topic which has been treated fairly seriously for centuries, including in the modern era. Other Vajrayana teachings also mention rainbow body phenomena.
Rigpa
The rainbow body phenomenon is a third person perspective of someone else attaining complete knowledge. Knowledge is the absence of delusion regarding the display of the basis. Rigpa has three wisdoms, which are kadag, lhun grub and thugs rje. Kadag deals with tregchöd. The lhun grub aspect has to do with esoteric practices, such as Thödgal, that self-liberate the human body into a Sambhogakāya. The symbol of Dzogchen is a Tibetan "A" wrapped in a thigle. The "A" represents kadag while the thigle represents lhun grub. The third wisdom, thugs rje, is the inseparability of the previous two wisdoms. In Dzogchen, a fundamental point of practice is to distinguishrigpa from sems. The ultimate fruition of the thodgal practices is a body of pure light, called a rainbow body If the four visions of thogal are not completed before death, then during death, from the point of view of an external observer, the dying person starts to shrink until he or she disappears. Usually fingernails, toenails and hair are left behind. The attainment of the rainbow body is typically accompanied by the appearance of lights and rainbows. Exceptional practitioners are held to realize a higher type of rainbow body without dying. Having completed the four visions before death, the individual focuses on the lights that surround the fingers. His or her physical body self-liberates into a nonmaterial body of light with the ability to exist and abide wherever and whenever as pointed by one's compassion.
Eyewitness account
Heart Drops of Dharmakaya, a Kunzang Nyingtic Dzogchen meditation manual commentated on by Lopon Tenzin Namdak, contains an eyewitness account of his main students' bodies shrinking and rainbows appearing in the sky at death.
List of those reported to have attained the rainbow body