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.

AttributeTypeDescription
accessStringIndicates whether the component can be used outside of its own namespace. Possible values are public (default), and global.
controllerStringThe server-side controller class for the component in the format namespace.myController or myController if using the default namespace.
descriptionStringA description of the component.
extendsComponentThe component to be extended.
extensibleBooleanSet to true if the component can be extended. The default is false.
implementsStringA comma-separated list of interfaces that the component implements.
isTemplateBooleanSet to true if the component is a template. The default is false. A template must have isTemplate="true" set in its aura:component tag.
templateComponentThe 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.