728x90
- 현재 개발 중인 블로그의 글쓰기 페이지입니다.
<Form.Group controlId="formContent">
<ReactQuill
value={content}
onChange={handleContentChange}
modules={{
toolbar: [
[{ 'header': '1'}, {'header': '2'}, { 'font': [] }],
[{ 'list': 'ordered'}, { 'list': 'bullet' }],
['bold', 'italic', 'underline'],
[{ 'color': [] }, { 'background': [] }],
[{ 'align': [] }],
['link', 'image'],
['clean']
],
}}
formats={[
'header', 'font', 'list', 'bullet',
'bold', 'italic', 'underline',
'color', 'background',
'align', 'link', 'image'
]}
className="form-control textarea"
/>
</Form.Group>
위의 코드를 통해, 특정부분의 폰트만 크게/작게, 두껍게/얇게 할 수 있습니다.
또한, 중간 중간 사진도 첨부할 수 있습니다.
1. 설치
npm install react-quill
npm install quill
2. 사용하려는 페이지에 import 문 추가
import ReactQuill from 'react-quill';
import 'react-quill/dist/quill.snow.css';
728x90
'웹개발' 카테고리의 다른 글
[React] SSE로 프론트엔드 쪽 코드 구현할때, 헤더(Authorization 등)설정하기 (feat. event-source-polyfill) (0) | 2024.08.20 |
---|---|
[React] Intersection Observer 로 무한 스크롤(무한로딩) 구현하기 (0) | 2024.08.20 |
[react, tyscript] 파이어베이스로 구글 로그인 구현하기 (0) | 2024.05.12 |
[네이버 맵 API] 커스텀 오버레이를 지도의 요소 중 최상단에 두고 싶을때 floatPane 사용하기 (0) | 2024.04.23 |
[vue.js] 카카오맵 API 사용하여 맵 불러오기[2] - 입력한 주소에 맞는 마커 (marker)생성하기 / 다음 우편번호 API 와 콜라보 (1) | 2024.03.22 |