The Lightning Design System docs have a lot of good information regarding your different options for displaying icons within HTML inputs.
Here's an example where you have an icon left of the input if you just copy/paste from the docs:
<div class="slds-form-element"> <label class="slds-form-element__label" for="text-input-id-1">Input Label</label> <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left"> <svg class="slds-icon slds-input__icon slds-input__icon_left slds-icon-text-default" aria-hidden="true"> <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/assets/icons/utility-sprite/svg/symbols.svg#search" /> </svg> <input type="text" id="text-input-id-1" class="slds-input" placeholder="Placeholder Text" /> </div> </div>
If you are using within a Salesforce Lightning app, you need to used a Lightning icon component instead of the HTML-centric SVG tag. It should look like this:
<div class="slds-form-element"> <label class="slds-form-element__label" for="text-input-id-1">Input Label</label> <div class="slds-form-element__control slds-input-has-icon slds-input-has-icon_left"> <lightning:icon iconName="utility:search" size="x-small" title="" /> <input type="text" id="text-input-id-1" class="slds-input" placeholder="Placeholder Text" /> </div> </div>
Although it's a bit more work that just going with <lightning:input type="search" label="Search" name="search" />, you'll have complete control over the icon versus relying on Salesforce to determine the icon based on the component's type attribute.