0.0.8 • Published 3 years ago

searchable-react-json-view v0.0.8

Weekly downloads
255
License
MIT
Repository
github
Last release
3 years ago

searchable-react-json-view

This is a fork of react-json-view with an extra search capability.
Please go there for the full readme.

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))
    }]}
/>