HTML
<template>
<lightning-radio-group name="radioGroup"
label="Radio Group"
options={options}
value={value}
type="radio"
class="customRadioCls"></lightning-radio-group>
</template>
JS
import { LightningElement, track } from 'lwc';
import customCSS from '@salesforce/resourceUrl/customCSS';
import { loadScript, loadStyle } from 'lightning/platformResourceLoader';
export default class RadioGroupBasic extends LightningElement {
renderedCallback() {
Promise.all([
loadStyle(this, customCSS);
])
}
@track value = '';
get options() {
return [
{ label: 'Sales', value: 'option1' },
{ label: 'Force', value: 'option2' },
];
}
}
I made custom CSS file and uploaded it to static resources. and then applied It worked.
customCSS
.customRadioCls .slds-form-element__control .slds-radio
{
display: inline-block !important;
}
lightning-radio-group
and see if there are any hooks provided by Salesforce for styling the component.