본문 바로가기
React/개념

아이콘 이용

by hihijh826 2024. 9. 11.
728x90
반응형
SMALL
npm install @fortawesome/react-fontawesome @fortawesome/free-solid-svg-icons

#필요한 type의 아이콘들만 골라서 설치 가능.
# Free icons styles

# 채워진 아이콘 종류로 사용
yarn add @fortawesome/free-solid-svg-icons

# 라인으로 된 아이콘 사용.
yarn add @fortawesome/free-regular-svg-icons

# 브랜드 로고 등의 종류 아이콘 사용.
yarn add fortawesome/free-brands-svg-icons
출처: <https://chlolisher.tistory.com/168> [클로리셔 작은 공간:티스토리]

📍import

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons';

📍 적용

ex) 화살표 모양

 <BackButton onClick={() => navigate(-1)} style={{ display: 'flex', alignItems: 'center' }}>
      <FontAwesomeIcon icon={faArrowLeft} style={{ marginRight: '5px' }} />
      돌아가기

Find the Perfect Icon for Your Project in Font Awesome 5 | Font Awesome

728x90
반응형
LIST

'React > 개념' 카테고리의 다른 글

JSON SERVER  (0) 2024.10.25
API  (0) 2024.10.25
useParams  (0) 2024.02.02
useRef ( 외부 클릭시 모달 창 닫기 기능)  (0) 2024.02.02
useDebounce  (0) 2024.02.02