Newer Version Available
Configure Drag-and-Drop Components for Community Builder
1. Add an Interface to Your Component
To appear as a drag-and-drop component in Community Builder, a component must implement the forceCommunity:availableForAllPageTypes interface.
After you create the Lightning component, it appears in the Components panel of all
Lightning communities in your org.
2. Add a Design Resource to Your Component Bundle
A design resource controls which component attributes are exposed in Community Builder. The design resource lives in the same folder as your .cmp resource, and describes the design-time behavior of the Lightning component—information that visual tools need to display the component in a page or app.
For example, to set a default value for an attribute, or make a Lightning component attribute available for administrators to edit in Community Builder, your component bundle needs a design resource.
Optional. Add an SVG Resource to Your Component Bundle
To define a custom icon for your component, add an SVG resource to the component bundle. The icon appears next to the component in the Community Builder Components panel.
If you don’t include an SVG resource, the system uses a default icon (
).
Here’s a simple red circle SVG resource to go with the “Hello World” component. An SVG resource must be named componentName.svg.
Optional. Add a CSS Resource to Your Component Bundle
To style your custom component, add a CSS resource to the component bundle.
Here’s the CSS for a simple class to go with the “Hello World” component. A CSS resource must be named componentName.css.