How do I access isOn in a toggle?

Question is in the title. I have unity 5.1.3f1 and i can’t figure out how to access it in my scripts. doing something like

rToggle.GetComponent().isOn;

where rToggle is the game object comtaining the toggle UI, does not work. Toggle doesn’t seem to be a component.

Or, how do I check whether a toggle is selected

Figured it out. Have to include UnityEngine.UI;