The react-org-chart component accepts a configuration object to customize the visual style, node dimensions, spacing, and animation behavior. You can control the following properties:
Layout and Sizing
nodeWidth: Width of the individual nodes.nodeHeight: Height of the individual nodes.nodeSpacing: Spacing between nodes.nodePaddingX: Horizontal padding inside the node.nodePaddingY: Vertical padding inside the node.nodeBorderRadius: Corner radius for the node container.avatarWidth: Width of the avatar image within the node.margin: An object defining { top, right, bottom, left } margins for the chart area.shouldResize: Boolean indicating if the chart should resize with its container.
Lines and Connections
lineType: The style of the connecting lines (e.g., 'angle').lineDepthY: The vertical depth of the line used for child nodes (typically matches node height).
Colors and Animation
animationDuration: Duration of animations in milliseconds.backgroundColor: Background color of the chart.borderColor: Color of the node borders.nameColor: Color of the person's name.titleColor: Color of the person's job title.reportsColor: Color used for reporting relationship lines or text.
const config = {
margin: { top: 20, right: 20, bottom: 20, left: 20 },
animationDuration: 350,
nodeWidth: 240,
nodeHeight: 120,
nodeSpacing: 12,
nodePaddingX: 16,
nodePaddingY: 16,
nodeBorderRadius: 4,
avatarWidth: 40,
lineType: 'angle',
lineDepthY: 120,
backgroundColor: '#fff',
borderColor: '#e6e8e9',
nameColor: '#222d38',
titleColor: '#617080',
reportsColor: '#92A0AD',
shouldResize: true
};