2.0.0 • Published 2 years ago

react-admin-json-view v2.0.0

Weekly downloads
336
License
MIT
Repository
github
Last release
2 years ago

React Admin JSON view GitHub release (latest by date) GitHub Workflow Status

JSON field and input for react-admin. Built with react-json-view.

Field:

JSON show

Input:

JSON edit

Installation

npm install react-admin-json-view

Usage

import { JsonField, JsonInput } from "react-admin-json-view";

// ...

export const ExampleShow = (props) => (
  <Show {...props}>
    <SimpleShowLayout>
      <JsonField
        source="example"
        jsonString={false} // Set to true if the value is a string, default: false
        reactJsonOptions={{
          // Props passed to react-json-view
          name: null,
          collapsed: true,
          enableClipboard: false,
          displayDataTypes: false,
        }}
      />
    </SimpleShowLayout>
  </Show>
);

export const ExampleEdit = (props) => (
  <Edit {...props}>
    <SimpleForm>
      <JsonInput
        source="example"
        validate={[required()]}
        jsonString={false} // Set to true if the value is a string, default: false
        reactJsonOptions={{
          // Props passed to react-json-view
          name: null,
          collapsed: true,
          enableClipboard: false,
          displayDataTypes: false,
        }}
      />
    </SimpleForm>
  </Edit>
);
2.0.0

2 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago