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:



3 comments:

  1. Thanks! Exactly what I was looking for

    ReplyDelete
  2. Hi, Can you also suggest how can we adjust the width of the dropdown, as my dropdown width is more than my combobox width?

    ReplyDelete