+ Start a Discussion

How to use Custom Labels in Lightning Design Attributes?

Rather than creating multiple Lightning components I would like to reuse my components and have the admin specify the Custom Label when they add the component to the page. I am not sure if this is possible although this article screenshots show it working https://salesforce.stackexchange.com/questions/155974/translate-designattribute

When I do the same thing it does not work; it returns the value the admin sets and not the value from the custom label.

Conversely, this article makes me think it is not possible as it says that "Label expressions in markup are supported in .cmp and .app resources only. "https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/components_config_for_app_builder_design_files.htm

Has anyone got this to work recently?

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global" >
 <aura:attribute name="Report" type="String" />

<!--Tried it like this as well-->
<p>{!'$Label.c.'+ v.Report}</p>

<design:component label="Report">
	<design:attribute name="Report" 
                      Description = "The custom label"

Amit Chaudhary 8Amit Chaudhary 8
Where you are using this Lightning component ? On flexi Pages ?

NOTE:- initially Lighning component took the value from default property then after that its storw it value on flexi pages.