react-jsonpath-viewer
v0.0.22
Published
React component for querying json using json path
Downloads
18
Readme
React JPV
This project aims to provide an updated version of react-jsonpath-editor, originally by jwatenbe.
Usage
Simply import JsonPathViewer from 'react-jsonpath-viewer'
.
| Prop name | Description | Type | Default | Optional |
| -------------- | ------------------------------------------ | :-------: | :-------: | :------: |
| json | JSON object to query | object | - | ❌ |
| highlightColor | Color to highlight queried json | string | - | ❌ |
| rootChar | JSON path prefix character(s) | string | $ | ✅ |
| component | Allows the use of a custom input component | component | <input>
| ✅ |
Styling
| ⚠️ Note: The JPV component is designed to be headless by default meaning it is not opinionated about its own styling. To apply a basic structure to the component a style.css file can be imported as such:
import 'react-jsonpath-viewer/dist/style.css';
For more advanced styling JPV adopts a BEM hierarchy of classes that can be utilized.