You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Use `.ts`** when you target multiple screen sizes or want easy future refinement — **recommended**.
144
+
**Use `.json`** when you want the fastest possible save-and-ship flow on a single target device.
145
+
146
+
---
147
+
132
148
## Quick start
133
149
134
-
### 1. Wrap your screen
150
+
### Option A — TypeScript `.ts` ⭐ (recommended, responsive)
151
+
152
+
In the inspector, click **↓ Save .ts (Responsive)** after capturing. The inspector writes a ready-to-use `.ts` file like this to your `src/skeletons/` folder:
153
+
154
+
```ts
155
+
// card.skeletons.ts — auto-generated by Skeleton Inspector
> **Why `.ts` over `.json`?** The `x`/`w` values are percentages of the container width, so the skeleton automatically scales to the right proportions on any device. `y`/`h` are exact dp from the live layout measurement. Capture once on any device — it looks right everywhere.
214
+
215
+
### Option B — JSON `.json` (quickest, single device)
216
+
217
+
Run the [Skeleton Inspector](#capturing-skeletons-with-skeleton-inspector), click **↓ Save skeletons.json**, then use the generated file:
importcardSkeletonsfrom'./skeletons/card.skeletons.json'; //added after first capture
221
+
importcardSkeletonsfrom'./skeletons/card.skeletons.json'; //generated by inspector
139
222
140
223
exportfunction ArticleScreen() {
141
224
const [loading, setLoading] =useState(true);
@@ -148,7 +231,7 @@ export function ArticleScreen() {
148
231
}
149
232
```
150
233
151
-
Before you've captured skeletons, `<Skeleton>` shows a blank fallback. The next section walks through capturing the real geometry.
234
+
Before you've set up skeleton data, `<Skeleton>` shows its children without a skeleton overlay. The next section walks through the inspector capture workflow.
152
235
153
236
---
154
237
@@ -246,18 +329,40 @@ The panel draws every skeleton with a numbered colour overlay and a data table b
246
329
247
330
### Step 9 — Save
248
331
249
-
Click **↓ Save skeleton.json**. The file lands in the Output Directory shown in the sidebar (default `src/skeletons`):
332
+
Two buttons appear after capture:
333
+
334
+
| Button | Output | Best for |
335
+
|---|---|---|
336
+
|**↓ Save .ts (Responsive)** ⭐ |`card.skeletons.ts`| Every device — x/w scale as percentages |
337
+
|**↓ Save skeletons.json**|`card.skeletons.json`| Quick snapshot, single device |
338
+
339
+
Files land in the Output Directory shown in the sidebar (default `src/skeletons`):
After saving, the inspector shows a **ready-to-paste code snippet** with the exact import line and `<Skeleton>` usage — just copy and drop it into your screen file.
347
+
255
348
---
256
349
257
350
## Using saved skeletons
258
351
259
352
### Import directly
260
353
354
+
**From the auto-generated `.ts` file (recommended):**
355
+
356
+
```tsx
357
+
importcardSkeletonsfrom'./skeletons/card.skeletons'; // ← .ts, no extension needed
0 commit comments