Component
aura:component
The root of the component hierarchy. Provides a default rendering implementation.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App, Lightning Out (Beta), Standalone Lightning App
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 lightning namespaces.
Every component is part of a namespace. For example, the button component is saved as button.cmp in the lightning namespace can be referenced in another component with the syntax <lightning:button label="Submit"/>, where label="Submit" is an attribute setting.
To create a component, follow this syntax.
The aura:component tag has the following optional attributes.
| Attribute | Type | Description |
|---|---|---|
| access | String | Indicates whether the component can be used outside of its own namespace. Possible values are public (default), and global. |
| controller | String | The server-side controller class for the component in the format namespace.myController or myController if using the default namespace. |
| description | String | A description of the component. |
| extends | Component | The component to be extended. |
| extensible | Boolean | Set to true if the component can be extended. The default is false. |
| implements | String | A comma-separated list of interfaces that the component implements. |
| isTemplate | Boolean | Set to true if the component is a template. The default is false. A template must have isTemplate="true" set in its aura:component tag. |
| template | Component | The template for this component. A template bootstraps loading of the framework and app. The default template is aura:template. You can customize the template by creating your own component that extends the default template. For more information, see the Lightning Aura Components Developer Guide. |