Lightning Component Bundle Design Resources

Use a design resource to control which attributes are exposed to the Lightning App Builder. A 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.

To make a Lightning component attribute available for administrators to edit in the Lightning App Builder, add a design:attribute node for the attribute into the design resource. An attribute marked as required in the component definition automatically appears for users in the Lightning App Builder, unless it has a default value assigned to it. Required attributes with default values and attributes not marked as required in the component definition must be specified in the design resource or they won’t appear for users.

A design resource supports only attributes of type int, string, or boolean.

What Can You Do with Design Resources?

Render a field as a picklist
To render a field as a picklist with static values, add a datasource onto the attribute in the design resource.
<design:attribute name="Name" datasource="value1,value2,value3" />
Any string attribute with a datasource in a design resource is treated as a picklist.
Set a default value on an attribute
You can set a default value on an attribute in a design resource.
<design:attribute name="Name" datasource="value1,value2,value3" default="value1" />
Restrict a component to one or more objects
Use the <sfdc:object> tag set to specify which objects your component is valid for.
For example, here’s a design resource that goes in a bundle with a “Hello World” component.
<design:component label="Hello World">
    <design:attribute name="subject" label="Subject" description="Name of the person you want to greet" />
    <design:attribute name="greeting" label="Greeting" />
</design:component>
Here’s the same design resource restricted to two objects.
<design:component label="Hello World">
    <design:attribute name="subject" label="Subject" description="Name of the person you want to greet" />
    <design:attribute name="greeting" label="Greeting" />
    <sfdc:objects>
        <sfdc:object>Custom__c</sfdc:object>
        <sfdc:object>Opportunity</sfdc:object>
    </sfdc:objects>
</design:component>
If an object is installed from a package, add the namespace__ string to the beginning of the object name when including it in the <sfdc:object> tag set. For example: objectNamespace__ObjectApiName__c.