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
+21-18Lines changed: 21 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,7 @@ const example = {
119
119
120
120
## Theme
121
121
122
-
By default, the `lightTheme` light theme is used, and a `darkTheme` dark theme configuration is built in
122
+
By default, the `lightTheme` light theme is used, and a `darkTheme` dark theme configuration is built in. The library provides multiple built-in themes including dark, light, nord, github themes, gruvbox, vscode, monokai, and basic themes.
123
123
124
124
```tsx mdx:preview
125
125
importReactfrom'react';
@@ -163,7 +163,7 @@ export default function Demo() {
163
163
}
164
164
```
165
165
166
-
Example of custom `vscode` theme styles:
166
+
Example of custom `vscode` theme styles using CSS custom properties:
167
167
168
168
```tsx mdx:preview
169
169
importReactfrom'react';
@@ -221,7 +221,7 @@ export default function Demo() {
221
221
222
222
## Online Editing Theme
223
223
224
-
Online custom style example, please check in the [documentation website](https://uiwjs.github.io/react-json-view/)
224
+
Interactive theme customization example with real-time color picker. You can modify theme colors and see changes instantly. Check the full interactive editor in the [documentation website](https://uiwjs.github.io/react-json-view/)
225
225
226
226
```tsx mdx:preview:&title=Online Editing Theme
227
227
importReact, { useState, useEffect } from'react';
@@ -349,9 +349,9 @@ export default function Demo() {
349
349
}
350
350
```
351
351
352
-
## Render
352
+
## Custom Rendering
353
353
354
-
**`v2`** version allows flexible customization of each "part" by providing small sub-components for customization, including value and type components: `<Bigint />`, `<Date />`, `<False />`, `<Float />`, `<Int />`, `<Map />`, `<Nan />`, `<Null />`, `<Set />`, `<String />`, `<True />`, `<Undefined />`, `<Url />`, and symbol components: `<ValueQuote />`, `<Arrow />`, `<Colon />`, `<Quote />`, `<BraceLeft />`, `<BraceRight />`, `<BracketsLeft />`, `<BracketsRight />`.
354
+
**`v2`** version allows flexible customization of each "part" by providing small sub-components for customization, including value and type components: `<Bigint />`, `<Date />`, `<False />`, `<Float />`, `<Int />`, `<Map />`, `<Nan />`, `<Null />`, `<Set />`, `<String />`, `<True />`, `<Undefined />`, `<Url />`, and symbol components: `<ValueQuote />`, `<Arrow />`, `<Colon />`, `<Quote />`, `<BraceLeft />`, `<BraceRight />`, `<BracketsLeft />`, `<BracketsRight />`. This example shows custom rendering of string values as images and custom colon symbols.
355
355
356
356
```tsx mdx:preview
357
357
importReactfrom'react';
@@ -390,7 +390,7 @@ export default function Demo() {
390
390
}
391
391
```
392
392
393
-
**Support for the URL(opens in a new tab) API.**
393
+
**URL Type Support** - Automatic recognition and display of URL objects with proper styling.
394
394
395
395
```tsx mdx:preview
396
396
importReactfrom'react';
@@ -412,7 +412,7 @@ export default function Demo() {
412
412
}
413
413
```
414
414
415
-
Supports certain partial customizations such as: `<Copied />`, `<CountInfo />`, `<CountInfoExtra />`, `<Ellipsis />`, `<KeyName />`, `<Row />`
415
+
**Component Customization** - Example showing custom copy functionality and URL rendering with clickable links. Supports partial customizations such as: `<Copied />`, `<CountInfo />`, `<CountInfoExtra />`, `<Ellipsis />`, `<KeyName />`, `<Row />`
416
416
417
417
```tsx mdx:preview
418
418
importReact, { Fragment } from'react';
@@ -465,7 +465,7 @@ export default function Demo() {
465
465
}
466
466
```
467
467
468
-
More in-depth customization ([#19](https://github.com/uiwjs/react-json-view/issues/19))
468
+
**Advanced Customization** - Deep customization example showing how to hide type indicators and quotes for a cleaner MongoDB-like object display ([#19](https://github.com/uiwjs/react-json-view/issues/19))
469
469
470
470
```tsx mdx:preview
471
471
importReactfrom'react';
@@ -518,7 +518,7 @@ export default function Demo() {
518
518
}
519
519
```
520
520
521
-
Inspector
521
+
**Array Inspector Style** - Example showing how to create a table-like inspector view for arrays, similar to browser DevTools object inspection.
522
522
523
523
```tsx mdx:preview
524
524
importReactfrom'react';
@@ -615,7 +615,7 @@ export default function Demo() {
615
615
}
616
616
```
617
617
618
-
Passing **as="tagName"** will automatically infer the type.
618
+
**Component Type Inference** - Passing **as="tagName"** will automatically infer the TypeScript type for better type safety.
619
619
620
620
```tsx
621
621
<JsonView.CountInfo
@@ -629,7 +629,7 @@ Passing **as="tagName"** will automatically infer the type.
629
629
/>
630
630
```
631
631
632
-
Add a click event on the data row
632
+
**Row Click Events** - Example showing how to add click event handlers to data rows for interactive functionality.
633
633
634
634
```tsx mdx:preview
635
635
importReactfrom'react';
@@ -677,6 +677,8 @@ export default function Demo() {
677
677
678
678
## Highlight Updates
679
679
680
+
Demonstration of automatic highlighting when JSON values change. The timer value updates every second and gets highlighted to show the change.
681
+
680
682
```tsx mdx:preview
681
683
importReact, { useState, useEffect } from'react';
682
684
importJsonViewfrom'@uiw/react-json-view';
@@ -717,7 +719,9 @@ export default function Demo() {
717
719
718
720
This feature can be disabled with `highlightUpdates={false}`, and the default color can be changed with `--w-rjv-update-color`.
719
721
720
-
## Do not display array index
722
+
## Hide Array Indices
723
+
724
+
Example showing how to hide array indices for a cleaner display by customizing the Colon and KeyName components.
721
725
722
726
```tsx mdx:preview
723
727
importReact, { Fragment } from'react';
@@ -746,10 +750,9 @@ export default function Demo() {
746
750
}
747
751
```
748
752
749
-
## Default Collapse/Expand
753
+
## Control Collapse/Expand State
750
754
751
-
Determines whether the node should be expanded on the first render. The default value of `collapsed` is `false`.
752
-
If both `collapsed` and `shouldExpandNodeInitially` are set, `collapsed` takes precedence; `shouldExpandNodeInitially` only takes effect when `collapsed` is `false`.
755
+
Controls the initial expand/collapse state of JSON nodes. Demonstrates both the `collapsed` prop and `shouldExpandNodeInitially` callback. The default value of `collapsed` is `false`. If both `collapsed` and `shouldExpandNodeInitially` are set, `collapsed` takes precedence; `shouldExpandNodeInitially` only takes effect when `collapsed` is `false`.
753
756
754
757
```tsx mdx:preview
755
758
importReact, { useState } from'react';
@@ -793,9 +796,9 @@ export default function Demo() {
793
796
}
794
797
```
795
798
796
-
## Modify Icon Style
799
+
## Custom Arrow Icons
797
800
798
-
Use built-in default icons.
801
+
Example showing how to customize expand/collapse arrow icons using built-in icon components.
799
802
800
803
```tsx mdx:preview
801
804
importReactfrom'react';
@@ -835,7 +838,7 @@ export default function Demo() {
835
838
}
836
839
```
837
840
838
-
Display of custom **svg**`icon` components
841
+
**Custom SVG Icons** - Example showing how to implement completely custom SVG icons for expand/collapse arrows with plus/minus symbols.
0 commit comments