radio group button horizontal tabs in lwc --

How to create horizontal tabs uses of selected radio group button in Lightning Web Component – LWC | How to create radio group button functionality horizontal tabs uses of the “lightning-radio-group” selected value in LWC – Salesforce Lightning Web Component


Hey guys, today in this post we are going to learn about How to create Radio Group Button Functionality horizontal tabs uses of the “lightning-radio-group” selected value in LWC – Salesforce Lightning Web Component.

A lightning-radio-group component represents a group of radio buttons that permit only one button to be selected at a time. The component renders radio button “input” elements and assigns the same value to the name attribute for each element. The common name attribute joins the elements in a group. If you select any radio button in that group, any previously selected button in the group is deselected.

In general, we don’t recommend setting the name attribute in lightning-radio-group. The component automatically generates a unique value for name if none is provided. The generated value ensures a common name for the “input” elements rendered for the radio button group, and is unique in the page. To know more details about lightning-radio-group, Click Here →


Files we used to create Radio Group Button Functionality in LWC →

lwcCustomRadioButton.html LWC HTML File Template HTML file to create Radio Group Button Functionality in LWC
lwcCustomRadioButton.js LWC JavaScript File In the javascript file create handleRadioChange function in LWC
lwcCustomRadioButton.js-meta.xml XML Meta File It is used to where this lightning web component file you want to display as lightning__AppPage, lightning__RecordPage, lightning__HomePage. Lightning Application It is used to call the component to preview on browser.



Final Output →

radio group button horizontal tabs in lwc --


Other related post that would you like to learn in Salesforce


  • Find the below steps ▾


Create Lightning Web Component HTML →

Step 1:- Create Lightning Web Component : lwcCustomRadioButton.html

SFDX:Lightning Web Component >> New >> lwcCustomRadioButton.html

lwcCustomRadioButton.html [Lightning Web Component HTML]


Create Lightning Web Component JavaScript →

Step 2:- Create Lightning Web Component : lwcCustomRadioButton.js

SFDX:Lightning Web Component >> New >> lwcCustomRadioButton.js

lwcCustomRadioButton.js [LWC JavaScript File]


Create Lightning Web Component Meta XML →

Step 3:- Create Lightning Web Component : lwcCustomRadioButton.js-meta.xml

SFDX:Lightning Web Component >> New >> lwcCustomRadioButton.js-meta.xml

lwcCustomRadioButton.js-meta.xml [LWC Meta Data XML]


Create Lightning Application →

Step 4:- Create Lightning Application :

From Developer Console >> File >> New >> Lightning Application [Component Application File]


radio group button horizontal tabs in lwc --

Further post that would you like to learn in Salesforce



FAQ (Frequently Asked Questions)

Can radio buttons be horizontal?

To make a horizontal radio button set, add the data-type='horizontal' to the fieldset . The framework will float the labels so they sit side-by-side on a line, hide the radio button icons and only round the left and right edges of the group.

How do you show radio buttons horizontally in lightning?

Currently in lightning component there is no direct way to display a lightning:radiobuttongroup horizontally. However, we have style class named slds-form-element__control and slds-radio which can perform this.

How do you add radio buttons in LWC?

Custom radio buttons are created by applying the . slds-radio class to a 'label' element. To remain accessible to all user agents, place an 'input' with type='radio' inside the 'label' element.

Related Topics | You May Also Like

  • Your reaction of the article ▾

Hi, This is Vijay Kumar behind the admin and founder of 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

Leave a Comment