Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

363
Views
How to use Font Awesome Icons is background-image in React

Can someone show me how to use Font Awesome Icons in my SearchBar component below? My intention is to import a Font Awesome Icon an use it as a background0image for the search field

import React from "react"
import styled from 'styled-components'
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faSearch } from "@fortawesome/free-solid-svg-icons"



const Input = styled.input`
  width: 400px;
  padding: 10px 10px 10px 50px;
  border: none;
  background-color: ${props => props.mode === true? "hsl(209, 23%, 22%)" : "hsl(0, 0%, 100%)"};
  color: ${props => props.mode === true? "white": "hsl(207, 26%, 17%)"};
  

  &:focus {
    outline: none;
  }
`

export default function SearchBar (props) {

    return (
        <Input
          mode = {props.mode}
          type = "text"
          placeholder = "Search for a Country"
          name = "search-query"
        >
        </Input>
    )
}

Any help will be appreciated.

Regards.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!