reablocks
Version:
Component library for React
48 lines (46 loc) • 1.26 kB
TypeScript
import { FC } from 'react';
export interface JsonTreeProps {
/**
* The data to be rendered as a JSON tree.
*/
data: {
[key: string]: any;
};
/**
* If true, all nodes in the JSON tree will be expanded by default.
*/
showAll?: boolean;
/**
* The limit for the number of nodes to show when `showAll` is false.
*/
showAllLimit?: number;
/**
* If true, the count of child nodes will be shown next to each node.
*/
showCount?: boolean;
/**
* If true, empty nodes will be shown in the JSON tree.
*/
showEmpty?: boolean;
/**
* If true, long text in nodes will be truncated and replaced with an ellipsis.
*/
ellipsisText?: boolean;
/**
* The maximum length of text in a node before it is truncated and replaced with an ellipsis.
*/
ellipsisTextLength?: number;
/**
* The depth at which the JSON tree nodes should be expanded by default.
*/
expandDepth?: number;
/**
* If true, the JSON tree will be rendered with a root node.
*/
root?: boolean;
/**
* The CSS class name to be applied to the JSON tree.
*/
className?: string;
}
export declare const JsonTree: FC<JsonTreeProps>;