JSON field and input for react-admin.
npm install react-admin-json-viewJSON field and input for react-admin.
Built with react-json-view.
Field:
Input:
``sh`
npm install react-admin-json-view
`jsx
import { JsonField, JsonInput } from "react-admin-json-view";
// ...
export const ExampleShow = (props) => (
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,
}}
/>
);
export const ExampleEdit = (props) => (
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,
}}
/>
);
``