Newer Version Available

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

Add Components to Apps

When you’re ready to add components to your app, first look at the built-in base components that Salesforce provides with the framework. You can also use these components by extending them or using composition to add them to custom components that you’re building.

For all the base components, see the Component Library. The lightning namespace includes many base components that implement visual elements common on web pages.

Note

If you can’t find a base component that meets your requirements, consider these options.

Components are encapsulated and their internals stay private, while their public shape is visible to consumers of the component. This strong separation gives component authors freedom to change the internal implementation details and insulates component consumers from those changes.

The public shape of a component is defined by the attributes that can be set and the events that interact with the component. The shape is essentially the API for developers to interact with the component. To design a new component, think about the attributes that you want to expose and the events that the component can initiate or respond to.

After you’ve defined the shape of any new components, developers can work on the components in parallel. This approach is useful if you have a team working on an app.

To add a custom component to your app, see Using the Developer Console.