1.0.0 • Published 11 months ago

@meetelise/searchable-react-json-view v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

searchable-react-json-view

This is a fork of searchable-react-json-view.

The only changes made to the original package are:

  • The addition of react@^17 as an accepted peer dependency
  • Upgrading the lockfile from v1 to v3

Install

yarn add searchable-react-json-view

New Props

NameTypeDefaultDescription
highlightSearchstringNoneWhat term to highlight - applies to number, string, boolean and object keys.
highlightSearchColorstringHighlight color
highlightCurrentSearchColorstringCurrent highlight color
customCopiedIconJSX.ElementnullCustom icon that appears after copying
customCopyIconJSX.ElementnullCustom icon for copy to clipboard
customActionsarray[]Custom actions that appear after copy, edit etc. each item should be: { icon: JSX.Element, onClick: clickedJsonValue => void }

Example

Custom actions & copy icon

<JsonViewer
    customCopiedIcon={<span>Copied</span>}
    customCopyIcon={<span>Copy</span>}
    customActions={[{
        icon: <span>A</span>,
        onClick: (value) => alert(JSON.stringify(value))
    }]}
/>