1
- import { Tabs , Card , Code , Bleed , Steps } from ' nextra/components'
1
+ import { Tabs , Card , Code , Pre , Bleed , Steps } from ' nextra/components'
2
2
import { ArrowRight , Hexagon , Box } from ' lucide-react'
3
3
import registry from ' ../../registry.json'
4
4
@@ -15,7 +15,7 @@ Supports large assets with lazy loading and automatic framing. Use it in modals,
15
15
Supports compressed gaussian splats.
16
16
17
17
<div className = " lg:outline lg:p-28 -mx-4 lg:-mx-6 mt-12 mb-0 rounded-t-lg bg-linear-to-br from-indigo-500 to-purple-600 relative" >
18
- { /* <OpenInV0Button url=" https://v0.dev/chat/api/open?url=https://playcanvas-react.vercel.app /r/splat-viewer.json" className="absolute top-4 right-4" /> */ }
18
+ <OpenInV0Button url = { ` https://${ process . env . VERCEL_URL } /r/splat-viewer.json ` } className = " absolute top-4 right-4" />
19
19
<Viewer.Splat src = { splatUrl } className = " aspect-2.39:1 bg-purple-200 rounded-t-lg lg:rounded-lg shadow-xl cursor-grab active:cursor-grabbing" >
20
20
<Viewer.Controls autoHide >
21
21
<div className = " flex gap-1 flex-grow" >
@@ -101,17 +101,36 @@ Supports compressed gaussian splats.
101
101
102
102
### Installation
103
103
104
- Install the component from your command line.
104
+ <Tabs items = { [' Manual' , ' Shadcn' ]} className = " !mt-0" tabClassName = " !mt-2" >
105
+ <Tabs.Tab title = ' Manual' className = " !mt-0 !rounded-t-none !rounded-b-xl" >
106
+ Follow the instructions on the [ Blocks page] ( /blocks/installation ) to install the component.
105
107
106
- ``` bash copy
107
- npx shadcn@latest add https:// playcanvas-react.vercel.app/r/splat-viewer.json
108
- ```
108
+ ``` bash copy
109
+ npm install @ playcanvas/blocks
110
+ ```
109
111
110
- Ensure the block is processed by Tailwind by adding the following to your ` index.css ` .
112
+ Install Tailwind and add the following to your ` index.css ` .
113
+
114
+ ``` css
115
+ @import " @playcanvas/blocks" ;
116
+ @source "../node_modules/@playcanvas/blocks";
117
+ ```
118
+ </Tabs.Tab >
119
+ <Tabs.Tab title = ' Shadcn' className = " !mt-0 !rounded-t-none !rounded-b-xl" >
120
+ Install the component from your command line.
121
+
122
+ ``` bash copy
123
+ npx shadcn@latest add https://playcanvas-react.vercel.app/r/splat-viewer.json
124
+ ```
125
+
126
+ Ensure the block is processed by Tailwind by adding the following to your ` index.css ` .
127
+
128
+ ``` css
129
+ @source "../node_modules/@playcanvas/blocks";
130
+ ```
131
+ </Tabs.Tab >
132
+ </Tabs >
111
133
112
- ``` css
113
- @source "../node_modules/@playcanvas/blocks";
114
- ```
115
134
116
135
### Anatomy
117
136
@@ -134,26 +153,26 @@ export default () => (
134
153
135
154
### API Reference
136
155
137
- #### SplatViewer
156
+ #### Splat
138
157
139
158
A responsive and composable component for displaying ** Gaussian splats** .
140
159
141
- { /* <TSDoc
160
+ <TSDoc
142
161
code = { `
143
162
import { Viewer } from '@playcanvas/blocks';
144
- type $ = React.ComponentProps<typeof Splat. Viewer>;
163
+ type $ = React.ComponentProps<typeof Viewer.Splat >;
145
164
export default $;
146
165
` }
147
- /> */ }
166
+ />
148
167
149
168
#### Controls
150
169
151
170
A simple container for UI controls that creates a sensible layout and optionally auto hides when the user is interacting.
152
171
153
- { /* <TSDoc
172
+ <TSDoc
154
173
code = { `
155
- import * as Splat from '@registry/splat-viewer/ ';
156
- type $ = React.ComponentProps<typeof Splat .Controls>;
174
+ import { Viewer } from '@playcanvas/blocks ';
175
+ type $ = React.ComponentProps<typeof Viewer .Controls>;
157
176
export default $;
158
177
` }
159
178
/>
@@ -164,8 +183,8 @@ A button for entering and exiting full screen mode.
164
183
165
184
<TSDoc
166
185
code = { `
167
- import * as Splat from '@registry/splat-viewer/ ';
168
- type $ = React.ComponentProps<typeof Splat .FullScreenButton>;
186
+ import { Viewer } from '@playcanvas/blocks ';
187
+ type $ = React.ComponentProps<typeof Viewer .FullScreenButton>;
169
188
export default $;
170
189
` }
171
190
/>
@@ -176,8 +195,8 @@ A button for downloading the current scene.
176
195
177
196
<TSDoc
178
197
code = { `
179
- import * as Splat from '@registry/splat-viewer/ ';
180
- type $ = React.ComponentProps<typeof Splat .DownloadButton>;
198
+ import { Viewer } from '@playcanvas/blocks ';
199
+ type $ = React.ComponentProps<typeof Viewer .DownloadButton>;
181
200
export default $;
182
201
` }
183
- /> */ }
202
+ />
0 commit comments