May 19, 2020

How to make radio button in front of label using Aura components in Salesforce?

Sample Code:

Component:

<aura:component implements="force:appHostable,forceCommunity:availableForAllPageTypes">
   
    <aura:attribute name="options" type="List" default="[
                                                        { 'value': 'option1', 'label': 'Sales' },
                                                        { 'value': 'option2', 'label': 'Force' }
                                                        ]"/>
    <aura:attribute name="value" type="String" default="option1"/>
   
    <div class="slds-box slds-theme--default">      
        <lightning:radioGroup name="radioGroup"
                              label="Radio Group"
                              options="{! v.options }"
                              value="{! v.value }"
                              type="radio"/>
    </div>
   
</aura:component>

Output:


No comments:

Post a Comment