October 15, 2020

Apply CSS to lightning combobox in LWC in Salesforce

Use style to apply CSS to lightning-combobox. Check the below code for example.
 
Sample Code:
<template>
    <div class="slds-box slds-theme--default">
        <lightning-combobox name="filter"
                            label="Status"
                            value={selectedValue}
                            variant="label-hidden"
                            options={options}
                            onchange={handleChange}
                            placeholder="Select Industry to filter"
                            style="color:grey;width:150px;"></lightning-combobox>
    </div>
</template>


Output:



No comments:

Post a Comment