1

I have t create one icon and need to show near to field name for combobox in modal window below is my code

<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
    <div class="slds-p-bottom_large slds-p-left_large">
        <lightning-card title="" variant="narrow">
        
            <lightning-icon  size="xx-small" alternative-text="help" icon-name="utility:info" title="Name" variant="info"></lightning-icon>                             
            
            <lightning-combobox 
                name="Name"
                label="Name"
                placeholder = "Please select Name"
                options = ""
                value = "" 
                onchange ="">
            </lightning-combobox>
            
        </lightning-card>
    </div>
</div>

but its coming like this enter image description here

Please suggest.

1 Answer 1

1

trying to re-arrange elements within a lightning-component is never a good idea, you probably wan to use a combobox blueprint instead,

this way, you can place your icon next to the

<my-icon>
<label class="slds-form-element__label" for="combobox-id-2" id="combobox-label-id-131">My Label</label>

and simply arrange with css.

3
  • can you please provide more details .how i can place icon next to combo box field name/label .I am not getting what you are trying to say. Could you please help me to provide any example if possible
    – santu
    Commented Feb 1, 2022 at 3:40
  • This is existing component and lightning-combox is used everywhere and its now bit difficult to change it to slds combox blueprint. Will consider that option as optimization, But current requirement standpoint do we have any solution
    – santu
    Commented Feb 1, 2022 at 4:21
  • placing an icon next to a label is basic web development, i'd suggest you have a look at Css Basics it really is not complicated. as per replacing multiple comboboxes, once you code it once, it should be trivial to replace multiple components across your code.
    – glls
    Commented Feb 1, 2022 at 12:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .