Search code examples
javascriptreactjsreact-bootstrap

React-bootstrap button with icon


I can add a button with text in react-bootstrap using code like

        <Button
          className={styles.feedbackButtonRating}
          variant={this.state.liked ? 'success' : 'light'}
          onClick={this.handleOnLikeClick}
        >
          {FEEDBACK_LIKE_BUTTON_TEXT}
        </Button>

Is there a way to replace {FEEDBACK_LIKE_BUTTON_TEXT} text with a thumb up icon?


Solution

  • You can try out using this npm package react-icons

    import { FaThumbsUp } from 'react-icons/fa';
    
    <Button>
        <FaThumbsUp />
    </Button>