# Component

`Component` contains methods to work with components.

## Methods

- **[addEventHandler()](/docs/platform/aura-platform/guide/ref-jsapi-component-addeventhandler.md)**

  Dynamically adds an event handler for a component or application event.

- **[addHandler()](/docs/platform/aura-platform/guide/ref-jsapi-component-addhandler.md)**

  Deprecated. Use `addEventHandler()` instead.

- **[addValueHandler()](/docs/platform/aura-platform/guide/ref-jsapi-component-addvaluehandler.md)**

  Adds handlers to values owned by the component.

- **[addValueProvider()](/docs/platform/aura-platform/guide/ref-jsapi-component-addvalueprovider.md)**

  Adds custom value providers to a component.

- **[autoDestroy()](/docs/platform/aura-platform/guide/ref-jsapi-component-autodestroy.md)**

  Sets a flag to tell the rendering service whether or not to destroy this component when it is removed from its rendering facet.

- **[clearReference()](/docs/platform/aura-platform/guide/ref-jsapi-component-clearreference.md)**

  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()](/docs/platform/aura-platform/guide/ref-jsapi-component-destroy.md)**

  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()](/docs/platform/aura-platform/guide/ref-jsapi-component-find.md)**

  Locates a component using its local ID (`aura:id`).

- **[get()](/docs/platform/aura-platform/guide/ref-jsapi-component-get.md)**

  Returns the value referenced using property syntax. For example, `cmp.get("v.attr")` returns the value of the `attr` attribute.

- **[getConcreteComponent()](/docs/platform/aura-platform/guide/ref-jsapi-component-getconcretecomponent.md)**

  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()](/docs/platform/aura-platform/guide/ref-jsapi-component-getelement.md)**

  If the component renders only a single element, return it. Otherwise, use `getElements()`.

- **[getElements()](/docs/platform/aura-platform/guide/ref-jsapi-component-getelements.md)**

  Returns a map of the elements rendered by the component.

- **[getEvent()](/docs/platform/aura-platform/guide/ref-jsapi-component-getevent.md)**

  Returns a new event instance of the named component event.

- **[getGlobalId()](/docs/platform/aura-platform/guide/ref-jsapi-component-getglobalid.md)**

  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()](/docs/platform/aura-platform/guide/ref-jsapi-component-getlocalid.md)**

  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()](/docs/platform/aura-platform/guide/ref-jsapi-component-getname.md)**

  Returns the component’s code-compatible camel case name, such as `'lightningButton'`.

- **[getReference()](/docs/platform/aura-platform/guide/ref-jsapi-component-getreference.md)**

  Returns a live reference to the value indicated using property syntax. This method is useful when you dynamically create a component.

- **[getSuper()](/docs/platform/aura-platform/guide/ref-jsapi-component-getsuper.md)**

  Returns the super component.

- **[getType()](/docs/platform/aura-platform/guide/ref-jsapi-component-gettype.md)**

  Returns the component’s canonical type; for example, `'lightning:button'`.

- **[getVersion()](/docs/platform/aura-platform/guide/ref-jsapi-component-getversion.md)**

  Returns the component’s version number.

- **[isConcrete()](/docs/platform/aura-platform/guide/ref-jsapi-component-isconcrete.md)**

  Returns `true` if the component is concrete, or `false` otherwise. A concrete component is a sub-component in an inheritance chain.

- **[isInstanceOf()](/docs/platform/aura-platform/guide/ref-jsapi-component-isinstanceof.md)**

  Checks whether a component is an instance of the given component or interface name.

- **[isValid()](/docs/platform/aura-platform/guide/ref-jsapi-component-isvalid.md)**

  Returns `true` if the component has not been destroyed.

- **[removeEventHandler()](/docs/platform/aura-platform/guide/ref-jsapi-component-removeeventhandler.md)**

  Dynamically removes a component event handler for the specified event.

- **[set()](/docs/platform/aura-platform/guide/ref-jsapi-component-set.md)**

  Sets the value referenced using property syntax.
