I have changed my design resource to this

<design:component label="DeveloperGuideTest">
        <design:attribute name="PickOne" datasource="value1,value2,value3" default="value2"/>

I have this in my component

<aura:attribute name="PickOne" type="String" access="global"/>

Now I couldn't figure it out how to use it as picklist on component.


Design attributes are used to setup your component in App Builder. So your code we'll be used when you open App Builder and drag & drop your component on the layout. You'll see at the right your attribute appear as a picklist.

If you want to use a picklist directly inside your component, you should use an attribute of type list of String instead:

<aura:attribute name="Picklist" type="String[]" access="global"/>

And then you can associate it to a component like lightning:select.

If the list is static, you may not even need your attribute, and add the values directly inside lightning:select.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.