Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to add a className prop #247

Open
ashhadsheikh opened this issue Feb 18, 2019 · 5 comments · May be fixed by #377
Open

Add ability to add a className prop #247

ashhadsheikh opened this issue Feb 18, 2019 · 5 comments · May be fixed by #377

Comments

@ashhadsheikh
Copy link

A lot of times, we've predefined classes that we want to use with this, need ability to pass that as prop. Thanks!

@lveillard
Copy link

I subscribe to this! I would love to be able to add classNames to the json viewer object.

When i do this:

<ReactJson
                            className="react-json-viewer rs-input"
                            src={json}
                          />{" "}

The component overrides it and shows only rect-json-viewer.

I could manually set each style element but my target here is to have the same style as rs-input elements, included hover and other actions css. Being able to do something like:
extendClassname = "rs-input anotherClass" would save a considerable amount of time and help to unify the code.

I could try to do a PR regarding this issue if you're ok to add a new prop!

@lveillard
Copy link

Quick win for those wondering:

                        <div className="rs-input">
                            <ReactJson
                              src={answer}
                            />
                        </div>

Does the trick

@obadakhalili
Copy link

Will this be considered? It should be a minimal requirement to have. Thanks

j-m added a commit to j-m/react-json-view that referenced this issue Sep 3, 2021
@j-m j-m linked a pull request Sep 3, 2021 that will close this issue
@renamartins
Copy link

renamartins commented Apr 5, 2024

Since this repository is dead, I looked at the fork suggested by 443465e

Looks like I cannot create issues in that fork. @Kikobeats, I'm tagging you since you seem to be one of the maintainers of https://github.com/microlinkhq/react-json-view. Two questions for you:

  1. is there a reason that repository does not accept tracking of issues?

  2. is it possible this issue here (and its fix PR feat: add className prop #377) be applied to https://github.com/microlinkhq/react-json-view ?

On another note, there is another fork that seems more receptive to feedback as it does allow reporting of issues (https://github.com/TexteaInc/json-viewer), although not sure how much divergence with the officially recommended fork. cc @pionxzh, if you care to elaborate.

Update: I was going through some issues and came across himself65/rich-data#10. Not exactly sure what is going on there, but from first glance it seems best to avoid https://github.com/TexteaInc/json-viewer to avoid trouble.

@pionxzh
Copy link

pionxzh commented Apr 5, 2024

Thanks for mentioning our repo. I can provide some insights:

  1. TexteaInc/json-viewer aims to cover most features of mac-s-g/react-json-view and has added several useful enhancements. It's more like "inspired by" mac-s-g/react-json-view instead of a fork.
  2. We welcome issue reports and feature requests. However, considering my current focus and limited time for open source contributions, I can only promise that issues will be prioritized and fixed within 3-10 days.
  3. Regarding the concern you mentioned, it's a dispute between an employer and a former employee. You can still use the library without any concerns.

himself65/rich-data is also a great library for those who want to fully customize features and layout. You can make the decision based on your requirements.

Thank you for your understanding. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants