This content describes an older version of this product.
View Latest
Components
Components are the functional units of the
Lightning
Component framework.
A component encapsulates a modular and potentially reusable section of UI, and
can range in granularity from a single line of text to an entire
application.
Use the Developer Console to
create components.
Component Markup
Component resources contain markup and have a .cmp suffix. The markup can contain text or references to other components, and also declares metadata about the component.
Component Bundles
A component bundle contains a component or an app and all its related resources.
Component IDs A component has two types of IDs: a local ID and a global ID.
HTML in Components An HTML tag is treated as a first-class component by the framework. Each HTML tag is translated into a component, allowing it to enjoy the same rights and privileges as any other component.
Component Attributes
Component attributes are like member variables on a class in Apex. They are typed fields that are set on a specific instance of a component, and can be referenced from within the component's markup using an expression syntax. Attributes enable you to make components more dynamic.
Component Composition
Composing fine-grained components in a larger component enables you to build more interesting components and applications.
Component Body
The root-level tag of every component is <aura:component>. Every component inherits the body attribute from <aura:component>.
Component Facets
A facet is any attribute of type Aura.Component[]. The body attribute is an example of a facet.
Using Labels
The framework supports labels to enable you to separate field labels from your code.
Localization
The framework provides client-side localization support on input and output components.
Adding Components to Apps
When you're ready to add components to your app, you should first look at the out-of-the-box components that come with the framework. You can also leverage these components by extending them or using composition to add them to custom components that you're building.