728x90
반응형
SMALL
1. npm 설치해주기
$ npm i @fortawesome/fontawesome-svg-core
$ npm i @fortawesome/free-solid-svg-icons @fortawesome/free-regular-svg-icons @fortawesome/free-brands-svg-icons
$ npm i @fortawesome/react-fontawesome
2. https://fontawesome.com/icons/
에서 사용할 아이콘 찾아주기
Coding Icons | Font Awesome
Coding icons from Font Awesome, the world's favorite icon library and toolset.
fontawesome.com
저는 faBars를 토글에 사용해볼게요.
기본 문법은 <FontAwesomeIcon icon={faBars} />
이렇게 사용하시면 되는데 꼭 import를 해주셔야합니다.
3. import 해주기
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBars } from "@fortawesome/free-solid-svg-icons";
728x90
반응형
LIST
'REACT' 카테고리의 다른 글
[리액트] 파일 업로드 한글 깨지는 이유, 해결방법 (0) | 2023.11.21 |
---|---|
리액트_node.js를 사용하여 CRUD 게시판 만들기 (0) | 2023.11.04 |
리액트_오류_This component must be used inside a <RecoilRoot> component. (0) | 2023.09.21 |
리액트_자바스크립트_연락처 10자리 11자리 12자리 지역번호02 정규식 (0) | 2023.09.19 |
[React] 컴포넌트 활용하기_헤더와 풋터 만들기 (0) | 2023.09.14 |