Feat : collapse the JSON by default
Hi,
First of all, thanks for creating this awesome JSON viewer! I'm using it in my project and it works great. However, I noticed that there is no built-in option to collapse all JSON nodes by default.
It would be really helpful if you could add a collapsed: true (or similar) option so that the JSON viewer initializes with all nodes collapsed. This would improve usability, especially when dealing with large JSON objects.
Proposed Feature:
Add a collapsed option (default: false). When set to true, all nodes should be collapsed on initialization. Optionally, allow setting a collapse level (e.g., collapsed: 1 to collapse only the first level). Current Workaround: Right now, I'm manually selecting all .json-toggle elements and triggering a click event after rendering, but having this as a built-in feature would be much more efficient.
Would love to hear your thoughts on this! Thanks again for your work.
Best, Tamilarasan
You can already do this by setting defaultInspectDepth={1}. Change the value to fit your needs.