Lightning Aura Components Developer Guide
Summer '26 (API version 67.0)
Spring '26 (API version 66.0)
Winter '26 (API version 65.0)
Summer '25 (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Summer '15 (API version 34.0)
Spring '15 (API version 33.0)
Winter '15 (API version 32.0)
Developing Secure Code
Testing Components
addEventHandler()
addHandler()
addValueHandler()
addValueProvider()
autoDestroy()
clearReference()
destroy()
find()
get()
getConcreteComponent()
getElement()
getElements()
getEvent()
getGlobalId()
getLocalId()
getName()
getReference()
getSuper()
getType()
getVersion()
isConcrete()
isInstanceOf()
isValid()
removeEventHandler()
set()
Newer Version Available
Component
Component contains methods to work with
components.
Methods
-
addEventHandler()
Dynamically adds an event handler for a component or application event. -
addHandler()
Deprecated. Use addEventHandler() instead. -
addValueHandler()
Adds handlers to values owned by the component. -
addValueProvider()
Adds custom value providers to a component. -
autoDestroy()
Sets a flag to tell the rendering service whether or not to destroy this component when it is removed from its rendering facet. -
clearReference()
Clears a live reference for the value passed in using property syntax. For example, if you use aura:set to set a value and later want to reset the value using component.set(), clear the reference before resetting the value. -
destroy()
Destroys the component and cleans up memory. After a component that is declared in markup is no longer in use, the framework automatically destroys it and frees up its memory. If you create a component dynamically in JavaScript and that component isn't added to a facet (v.body or another attribute of type Aura.Component[]), you have to destroy it manually using destroy() to avoid memory leaks. -
find()
Locates a component using its local ID (aura:id). -
get()
Returns the value referenced using property syntax. For example, cmp.get("v.attr") returns the value of the attr attribute. -
getConcreteComponent()
Gets the concrete implementation of a component. If the component is concrete, the method returns the component itself. For example, call this method to get the concrete component of a super component. -
getElement()
If the component renders only a single element, return it. Otherwise, use getElements(). -
getElements()
Returns a map of the elements rendered by the component. -
getEvent()
Returns a new event instance of the named component event. -
getGlobalId()
Gets the global ID, which is the generated globally unique id of the component. It can be used to locate the instance later, but will change across page loads. -
getLocalId()
Gets the ID set using the aura:id attribute. Pass the local ID into find() on the parent component to locate this child component. -
getName()
Returns the component’s code-compatible camel case name, such as 'lightningButton'. -
getReference()
Returns a live reference to the value indicated using property syntax. This method is useful when you dynamically create a component. -
getSuper()
Returns the super component. -
getType()
Returns the component’s canonical type; for example, 'lightning:button'. -
getVersion()
Returns the component’s version number. -
isConcrete()
Returns true if the component is concrete, or false otherwise. A concrete component is a sub-component in an inheritance chain. -
isInstanceOf()
Checks whether a component is an instance of the given component or interface name. -
isValid()
Returns true if the component has not been destroyed. -
removeEventHandler()
Dynamically removes a component event handler for the specified event. -
set()
Sets the value referenced using property syntax.