@@ -9,26 +9,32 @@ This guide shows you how to add frames rendering to your next.js + tailwind app
9
9
10
10
## Steps
11
11
12
- 1 . Create a new repo
12
+ ::::steps
13
13
14
- ` npx create-next-app@latest my-project --ts --eslint --tailwind --app `
14
+ ### Create a new repo
15
15
16
- ` cd my-project `
17
16
18
- ` yarn add @frames .js/render `
17
+ Create a new Next .js app
19
18
20
- ` yarn install `
19
+ ``` sh
20
+ npx create-next-app@latest my-project --ts --eslint --tailwind --app
21
+ cd my-project
22
+ ```
23
+
24
+ Add ` @frames.js/render ` to your project
21
25
22
- 2 . Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
23
- ``` tsx filename="// ./app/frames/route.tsx"
24
- // ./app/frames/route.tsx
26
+ ``` sh
27
+ yarn add @frames.js/render
28
+ ```
29
+
30
+ ### Add proxies for routing frame requests via your backend for privacy + preventing CORS issues
31
+ ``` tsx [./app/frames/route.tsx]
25
32
export { GET , POST } from " @frames.js/render/next" ;
26
33
```
27
34
28
- 3 . Add the renderer to your page
35
+ ### Add the renderer to your page
29
36
30
- ``` tsx filename="// ./app/page.tsx"
31
- // ./app/page.tsx
37
+ ``` tsx [./app/page.tsx]
32
38
" use client" ;
33
39
import {
34
40
FrameUI ,
@@ -81,10 +87,9 @@ export default function Page() {
81
87
82
88
```
83
89
84
- 4 . In order for the styles to work, your project should have tailwind set up as well as the tailwind.config.js rule
90
+ ### In order for the styles to work, your project should have tailwind set up as well as the tailwind.config.js rule
85
91
86
- ``` tsx filename="// tailwind.config.js"
87
- // tailwind.config.js
92
+ ``` tsx [tailwind.config.js]
88
93
const config = {
89
94
// ...
90
95
content: [
@@ -97,10 +102,9 @@ const config = {
97
102
}
98
103
```
99
104
100
- 5 . Allow images from any domain
105
+ ### Allow images from any domain
101
106
102
- ``` tsx filename="// next.config.js"
103
- // next.config.js
107
+ ``` tsx [next.config.js]
104
108
const nextConfig = {
105
109
images: {
106
110
remotePatterns: [
@@ -113,10 +117,10 @@ const nextConfig = {
113
117
};
114
118
```
115
119
116
- 6 . Run ` yarn run dev `
117
-
118
- 7 . Done! 🎉
120
+ ### Run ` yarn run dev `
119
121
122
+ ### Done! 🎉
123
+ ::::
120
124
121
125
### Optional
122
126
0 commit comments