Newer Version Available

This content describes an older version of this product. View Latest

aura:component

The root of the component hierarchy. Provides a default rendering implementation.

Components are the functional units of Aura, which encapsulate modular and reusable sections of UI. They can contain other components or HTML markup. The public parts of a component are its attributes and events. Aura provides out-of-the-box components in the aura and ui namespaces.

Every component is part of a namespace. For example, the button component is saved as button.cmp in the ui namespace can be referenced in another component with the syntax <ui:button label="Submit"/>, where label="Submit" is an attribute setting.

To create a component, follow this syntax.
1<aura:component>
2  <!-- Optional coponent attributes here -->
3  <!-- Optional HTML markup -->
4  <div class="container"> 
5    Hello world!
6    <!-- Other components -->
7  </div>
8</aura:component>

Attributes

Attribute Name Attribute Type Description Required?
body Component[] The body of the component. In markup, this is everything in the body of the tag.