react-json-view icon indicating copy to clipboard operation
react-json-view copied to clipboard

Additional Customization Options for Icons and Formatting

Open chacha912 opened this issue 9 months ago • 2 comments

First, I'd like to thank you for maintaining react-json-view. It's an excellent library that I've been using extensively in my projects!

I've made some custom modifications to meet specific UI requirements:

  1. Added an iconStyle='arrow' option to change the default triangle icons to arrows
  2. Implemented a displayBraceColon={false} prop to hide the colon after braces

Image

My Questions

  • Are there existing, documented ways to achieve these customizations that I might have missed?
  • If not, would you consider these features as potential additions to the library?

I'd be happy to contribute a PR for these features if you think they would be valuable additions to the library. I share the commits where I implemented these customizations for your reference. https://github.com/chacha912/react-json-view/commit/a06cb3e709d0374f1bb634e500b6e06192bede80

Thank you for considering my request!

chacha912 avatar Mar 11 '25 07:03 chacha912

Hi @chacha912

In recommend, rename displayBraceColon to displayCompact. This better illustrates the output visual effect rather than the behavior. Naming displayCompact mean to do more than hide the colon after braces if you or other can in future.

PS. i borrow the naming from gmail setting ^_^

pgliang001 avatar Mar 15 '25 05:03 pgliang001

@pgliang001 Thanks for the good suggestion. I'll make the changes and submit a PR.

chacha912 avatar Mar 16 '25 11:03 chacha912