We use $A. util. toggleClass to add or remove a CSS style on a component or element during runtime. To retrieve the class name on a component, use component.