Skip to content

Add ability to add a className prop #247

Open
@ashhadsheikh

Description

@ashhadsheikh

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

Activity

lveillard

lveillard commented on Jun 16, 2020

@lveillard

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

lveillard commented on Jun 16, 2020

@lveillard

Quick win for those wondering:

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

Does the trick

obadakhalili

obadakhalili commented on Jul 16, 2021

@obadakhalili

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

added a commit that references this issue on Sep 3, 2021
db5c750
linked a pull request that will close this issue on Sep 3, 2021
renamartins

renamartins commented on Apr 5, 2024

@renamartins

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

pionxzh commented on Apr 5, 2024

@pionxzh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @ashhadsheikh@pionxzh@lveillard@obadakhalili@renamartins

      Issue actions

        Add ability to add a className prop · Issue #247 · mac-s-g/react-json-view