Skip to content

Commit ceda89b

Browse files
committed
doc: update document.
1 parent 4685111 commit ceda89b

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

core/README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const example = {
119119

120120
## Theme
121121

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.
123123

124124
```tsx mdx:preview
125125
import React from 'react';
@@ -163,7 +163,7 @@ export default function Demo() {
163163
}
164164
```
165165

166-
Example of custom `vscode` theme styles:
166+
Example of custom `vscode` theme styles using CSS custom properties:
167167

168168
```tsx mdx:preview
169169
import React from 'react';
@@ -221,7 +221,7 @@ export default function Demo() {
221221

222222
## Online Editing Theme
223223

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/)
225225

226226
```tsx mdx:preview:&title=Online Editing Theme
227227
import React, { useState, useEffect } from 'react';
@@ -349,9 +349,9 @@ export default function Demo() {
349349
}
350350
```
351351

352-
## Render
352+
## Custom Rendering
353353

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.
355355

356356
```tsx mdx:preview
357357
import React from 'react';
@@ -390,7 +390,7 @@ export default function Demo() {
390390
}
391391
```
392392

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.
394394

395395
```tsx mdx:preview
396396
import React from 'react';
@@ -412,7 +412,7 @@ export default function Demo() {
412412
}
413413
```
414414

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 />`
416416

417417
```tsx mdx:preview
418418
import React, { Fragment } from 'react';
@@ -465,7 +465,7 @@ export default function Demo() {
465465
}
466466
```
467467

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))
469469

470470
```tsx mdx:preview
471471
import React from 'react';
@@ -518,7 +518,7 @@ export default function Demo() {
518518
}
519519
```
520520

521-
Inspector
521+
**Array Inspector Style** - Example showing how to create a table-like inspector view for arrays, similar to browser DevTools object inspection.
522522

523523
```tsx mdx:preview
524524
import React from 'react';
@@ -615,7 +615,7 @@ export default function Demo() {
615615
}
616616
```
617617

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.
619619

620620
```tsx
621621
<JsonView.CountInfo
@@ -629,7 +629,7 @@ Passing **as="tagName"** will automatically infer the type.
629629
/>
630630
```
631631

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.
633633

634634
```tsx mdx:preview
635635
import React from 'react';
@@ -677,6 +677,8 @@ export default function Demo() {
677677

678678
## Highlight Updates
679679

680+
Demonstration of automatic highlighting when JSON values change. The timer value updates every second and gets highlighted to show the change.
681+
680682
```tsx mdx:preview
681683
import React, { useState, useEffect } from 'react';
682684
import JsonView from '@uiw/react-json-view';
@@ -717,7 +719,9 @@ export default function Demo() {
717719

718720
This feature can be disabled with `highlightUpdates={false}`, and the default color can be changed with `--w-rjv-update-color`.
719721

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.
721725

722726
```tsx mdx:preview
723727
import React, { Fragment } from 'react';
@@ -746,10 +750,9 @@ export default function Demo() {
746750
}
747751
```
748752

749-
## Default Collapse/Expand
753+
## Control Collapse/Expand State
750754

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`.
753756

754757
```tsx mdx:preview
755758
import React, { useState } from 'react';
@@ -793,9 +796,9 @@ export default function Demo() {
793796
}
794797
```
795798

796-
## Modify Icon Style
799+
## Custom Arrow Icons
797800

798-
Use built-in default icons.
801+
Example showing how to customize expand/collapse arrow icons using built-in icon components.
799802

800803
```tsx mdx:preview
801804
import React from 'react';
@@ -835,7 +838,7 @@ export default function Demo() {
835838
}
836839
```
837840

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.
839842

840843
```tsx mdx:preview
841844
import React from 'react';

0 commit comments

Comments
 (0)