6

I am using lightning:input type="toggle" base component and I need to set the text underneath the toggle button.

By default checked displays Active:

enter image description here

And unchecked displays Inactive:

enter image description here

Here is my code:

<lightning:input type="toggle"
                 label="My Label: "
                 name="toggle"
                 checked="{!v.record.myCheckbox__c}"/>

I want to change these messages and cannot find a way to do it - is there a way?

9

Use messageToggleActive and messageToggleInactive:

<lightning:input name="x"
                 label="x"
                 type="toggle"
                 messageToggleActive="Done"
                 messageToggleInactive="Not Done" />

Not Done


Done

  • Works like a charm! so many Attributes for this component so I have missed these. Thanks – Itai Shmida Feb 27 '18 at 16:50

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.