How to display radio buttons horizontally and create tab from selected radio button value in Lightning Aura Components Salesforce | How to display radio button value in aura:component using JavaScript component controller Salesforce

Vijayk
2 min readJun 28, 2022

--

Hey guys, today in this post we are going to learn about How to display radio buttons horizontally and create tab from selected radio button value in Lightning Aura Components Salesforce.

A ui:inputRadio component represents a radio button whose state is controlled by the value and disabled attributes. It’s rendered as an HTML input tag of type radio. To apply Lightning Design System styling, we recommend that you use lightning:radioGroup instead of ui:inputRadio.

To group your radio buttons together, specify the name attribute with a unique name. To know more details about ui:inputRadio, Click Here →.

Files we used to display radio buttons horizontally in aura:component →

CustomRadioButtonCmp.cmp

Lightning Component

It is used to display radio buttons horizontally in lightning component

CustomRadioButtonCmpController.js

JavaScript Controller

It is hold Javascript click function to show/hide container based on radio buttons value.

customRadioButtonApp.app

Lightning Application

It is used to call the component and preview on browser.

Final Output → Get source code live demo..

Other related post that would you like to learn in LWC

Create Lightning Component →

Step 1:- Create Lightning Component : CustomRadioButtonCmp.cmp

From Developer Console >> File >> New >> Lightning Component

CustomRadioButtonCmp.cmp [Lightning Component File]

Create JavaScript Controller →

Step 2:- Create Lightning Component : CustomRadioButtonCmpController.js

From Developer Console >> File >> New >> Lightning Component >> JavaScript Controller

CustomRadioButtonCmpController.js [JavaScript Controller]

Create Lightning Application →

Step 3:- Create Lightning Application : customRadioButtonApp.app

From Developer Console >> File >> New >> Lightning Application

customRadioButtonApp.app [Component Application File]

Further post that would you like to learn in LWC FAQ (Frequently Asked Questions)

Final Output → Get source code live demo..

Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

Originally published at https://www.w3web.net on June 28, 2022.

--

--