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
Copy file name to clipboardExpand all lines: core/README.md
+41-2Lines changed: 41 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ export default function Demo() {
249
249
displayDataTypes={false}
250
250
style={{
251
251
'--w-rjv-background-color': '#ffffff',
252
-
'--w-rjv-border-left': '0',
252
+
'--w-rjv-border-left-width': '0',
253
253
}}
254
254
components={{
255
255
braces: () => <span />,
@@ -266,6 +266,45 @@ export default function Demo() {
266
266
}
267
267
```
268
268
269
+
**Preview Picture**
270
+
271
+
```tsx mdx:preview
272
+
importReactfrom'react';
273
+
importJsonViewfrom'@uiw/react-json-view';
274
+
275
+
const object = {
276
+
avatar: 'https://i.imgur.com/MK3eW3As.jpg',
277
+
string: 'Lorem ipsum dolor sit amet',
278
+
integer: 42,
279
+
}
280
+
281
+
function value({ type, children, ...props }) {
282
+
if (type==='string'&&/\.(jpg)$/.test(children)) {
283
+
return (
284
+
<span{...props}>
285
+
<imgsrc={children}height="36" />
286
+
</span>
287
+
);
288
+
}
289
+
}
290
+
291
+
exportdefaultfunction Demo() {
292
+
return (
293
+
<JsonView
294
+
value={object}
295
+
keyName="root"
296
+
// quotes=""
297
+
displayObjectSize={false}
298
+
displayDataTypes={false}
299
+
style={{
300
+
'--w-rjv-background-color': '#ffffff',
301
+
}}
302
+
components={{ value }}
303
+
/>
304
+
)
305
+
}
306
+
```
307
+
269
308
## Modify Icon Style
270
309
271
310
Use built-in default icons.
@@ -433,7 +472,7 @@ Here is the size benchmark (using [bundlephobia.com](https://bundlephobia.com))
433
472
| react-json-tree-viewer |[](https://bundlephobia.com/result?p=react-json-tree-viewer)|[](https://bundlephobia.com/result?p=react-json-tree-viewer)|[](https://bundlephobia.com/result?p=react-json-tree-viewer)|[](https://github.com/nsisodiya/react-json-viewer/commits)|
434
473
| react-domify |[](https://bundlephobia.com/result?p=react-domify)|[](https://bundlephobia.com/result?p=react-domify)|[](https://bundlephobia.com/result?p=react-domify)|[](https://github.com/JedWatson/react-domify/commits)|
435
474
| react18-json-view |[](https://bundlephobia.com/result?p=react18-json-view)|[](https://bundlephobia.com/result?p=react18-json-view)|[](https://bundlephobia.com/result?p=react18-json-view)|[](https://github.com/YYsuni/react18-json-view/commits)|
436
-
|@textea/json-viewer|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://github.com/uiwjs/json-viewer/commits)|
475
+
|@textea/json-viewer|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://bundlephobia.com/result?p=@textea/json-viewer)|[](https://github.com/TexteaInc/json-viewer/commits)|
0 commit comments