UNPKG

@redheadphone/react-json-grid

Version:

React Component that converts JSON to nested grid tables.

38 lines (34 loc) 955 B
import React from 'react'; type keyPathNode = string | string[] | number | number[]; interface JSONObject { [key: string]: any; } interface Theme { bgColor?: string; borderColor?: string; selectHighlightBgColor?: string; cellBorderColor?: string; keyColor?: string; indexColor?: string; numberColor?: string; booleanColor?: string; stringColor?: string; objectColor?: string; tableHeaderBgColor?: string; tableIconColor?: string; searchHighlightBgColor?: string; } interface JSONGridProps { data: JSONObject; defaultExpandDepth?: number; defaultExpandKeyTree?: JSONObject; onSelect?: (keyPath: keyPathNode[]) => void; onBlur?: () => void; highlightSelected?: boolean; searchText?: string | null; theme?: string; customTheme?: Theme; } declare const JSONGrid: React.FC<JSONGridProps>; export { JSONGrid as default }; export type { JSONGridProps, keyPathNode };