8484<br />
8585
8686## Top Icons Feature
87- <img width =" 450- " alt =" 스크린샷 2023-02-27 오후 9 53 09 " src =" https://user-images.githubusercontent. com/64779472/221569330-cf13379a-b21e-43a1-a766-b22d874da60d.png " >
87+ <img width =" 450 " alt =" 스크린샷 2023-02-27 오후 9 53 09 " src =" https://github. com/ssi02014/react-thumbnail-generator/assets/64779472/d23a255e-3dc3-4140-b016-26f77e7afe1e " >
8888
89- - 1: Picture
89+ - 1: Background Picture
90+ - 2: Text Align (start, center, end)
9091- 2: Background Color
9192- 3: Font Color
9293- 4: Font Stroke Color
9394- 5: Blur Effect
9495
95- <br />
96+ <hr />
9697
9798## How to use React 😊
9899### STEP 1️⃣
99- - Install library
100+ - Install Package
100101```
101102yarn add react-thumbnail-generator
102103or
@@ -106,28 +107,8 @@ npm install react-thumbnail-generator
106107<br />
107108
108109### STEP 2️⃣
109- - Enter the desired ID of the div that you want to add to ` public/index.html ` .
110- - To avoid being affected by CSS inheritance, ` <ThumbnailGenerator> ` is applied with a Portal.
111-
112- ``` html
113- <!DOCTYPE html>
114- <html lang =" en" >
115- <head >
116- <!-- ... -->
117- </head >
118- <body >
119- <div id =" root" ></div >
120- <!-- Enter the ID you want. -->
121- <div id =" thumbnail-generator" ></div >
122- </body >
123- </html >
124-
125- ```
126-
127- <br />
128-
129- ### STEP 3️⃣
130110- Add ` <ThumbnailGenerator> ` component.
111+ - ThumbnailGenerator is automatically rendered as a ` document.body ` child by default using ` Portal ` .
131112
132113``` jsx
133114import ThumbnailGenerator from ' react-thumbnail-generator' ;
@@ -137,11 +118,6 @@ const App = () => {
137118 return (
138119 < div>
139120 < ThumbnailGenerator
140- id= " thumbnail-generator"
141- // Please enter the ID of the div you added in public/index.html.
142- // If you do not specify an ID, it will be rendered in the "root" div.
143- // However, this may cause the UI to change due to CSS inheritance.
144-
145121 buttonIcon= {< img src= {iconImage} width= {30 } height= {30 } alt= " iconImage" / > }
146122 // To insert the inner icon of the button that opens the thumbnail modal, use the ReactNode.
147123 // If you do not include this option, the default icon will be used.
@@ -170,47 +146,46 @@ const App = () => {
170146 )
171147}
172148```
149+
173150<br />
174151
175152## How to use Next 😊
176153### STEP 1️⃣
177- - Enter the desired ID of the div that you want to add to ` _document ` .
178- ``` jsx
179- import { Html , Head , Main , NextScript } from " next/document" ;
180-
181- export default function Document () {
182- return (
183- < Html lang= " en" >
184- < Head / >
185- < body>
186- < Main / >
187- < div id= " thumbnail-generator" >< / div>
188- < NextScript / >
189- < / body>
190- < / Html>
191- );
192- }
154+ - Install Package
155+ ```
156+ yarn add react-thumbnail-generator next-transpile-modules
157+ or
158+ npm install react-thumbnail-generator next-transpile-modules
193159```
194160
195161<br />
196162
197163### STEP 2️⃣
164+ - Modify next.config
165+ ``` js
166+ /** @type {import('next').NextConfig} */
167+ const nextConfig = {
168+ reactStrictMode: true ,
169+ transpilePackages: [" react-step-parallax" ],
170+ };
171+
172+ module .exports = nextConfig;
173+ ```
174+
175+ <br />
176+
177+ ### STEP 3️⃣
198178- Add ` <ThumbnailGenerator> ` to dynamic import.
199179
200180``` jsx
201181import dynamic from " next/dynamic" ;
202182import Image from " next/image" ;
203183
204- const ThumbnailGenerator = dynamic (() => import (" react-thumbnail-generator" ), {
205- ssr: false ,
206- });
207-
208184export default function Home () {
209185 return (
210186 <>
211187 < ThumbnailGenerator
212- id= " thumbnail-generator"
213- buttonIcon= {< Image src= {profilePic} width= {30 } height= {30 } alt= " buttonIcon" / > }
188+ buttonIcon= {< Image src= {buttonIcon} width= {30 } height= {30 } alt= " buttonIcon" / > }
214189 / >
215190 < / >
216191 );
@@ -241,7 +216,6 @@ export default function Home() {
241216 </head >
242217 <body >
243218 <div id =" root" ></div >
244- <div id =" thumbnail-generator" ></div >
245219 </body >
246220</html >
247221```
@@ -259,7 +233,6 @@ const App = () => {
259233 return (
260234 < div>
261235 < ThumbnailGenerator
262- id= " thumbnail-generator"
263236 additionalFontFamily= {[" Zeyada" ]} // (*)
264237 / >
265238 < / div>
@@ -275,11 +248,10 @@ const App = () => {
275248<img src =" https://user-images.githubusercontent.com/64779472/220677341-7b6c062f-f0f6-49dd-8bcd-b402b61660ea.png " width =" 450 " >
276249
277250<br />
251+ <br />
252+ <hr />
278253
279254## API 📄
280- - id
281- - ** Optional**
282- - Type: ` string `
283255- buttonIcon
284256 - ** Optional**
285257 - Default: <img width =" 43 " alt =" 스크린샷 2023-02-20 오후 10 48 05 " src =" https://user-images.githubusercontent.com/64779472/220125380-77aaaa79-9baf-4252-aa46-a44e6e91dd3d.png " >
0 commit comments