Styling Props
Styling props allow you to customize the visual appearance and layout of your tree, including styles, dimensions, and custom renderers.style
innerStyle
CSS styles applied to the inner scrollable container. Useful for adding padding without affecting the scrollbar.Difference from
TypeScript Signature
Example: Inner Padding
Example: Custom Scrollbar
Difference from style
style: Applied to outer container (affects borders, overall size)innerStyle: Applied to scrollable content (affects padding, background of content area)
className
scaffoldBlockPxWidth
Width in pixels of the blocks containing the tree structure lines (the indentation guides).
TypeScript Signature
Default
44Example: Compact Indentation
Example: Wide Indentation
Visual Comparison
Use Cases
- Compact trees: Use smaller values (25-35px) for space-constrained layouts
- Readable deep trees: Use larger values (50-70px) when you have deeply nested structures
- Mobile: Use smaller values (25-30px) for mobile screens
rowHeight
Height of each tree row. Can be a fixed number or a function that returns height based on node data.
TypeScript Signature
Default
62Example: Fixed Height
Example: Compact Rows
Example: Dynamic Height Based on Content
Example: Different Heights by Node Type
When using a function for
rowHeight, ensure it returns consistent values for the same node to avoid rendering issues.slideRegionSize
Size in pixels of the region near the edges that triggers auto-scrolling during drag operations.
TypeScript Signature
Default
100Example: Smaller Scroll Region
Example: Disable Auto-scroll
Example: Larger Scroll Region for Touch Devices
How It Works
When dragging a node:- Dragging within slideRegionSize pixels of the top edge scrolls up
- Dragging within slideRegionSize pixels of the bottom edge scrolls down
- The closer to the edge, the faster the scroll
theme
Theme configuration object for customizing the tree’s appearance. Allows you to override default renderers and styling.
TypeScript Signature
Example: Custom Theme Object
Example: Dark Theme
The
theme prop is a convenient way to package multiple styling options together. Individual props like style and scaffoldBlockPxWidth will override theme values if both are provided.nodeContentRenderer
placeholderRenderer
Complete Styling Example
Related Props
- See Callback Props for
generateNodePropswhich adds dynamic styles to nodes - See Behavior Props for functional configuration
- See Required Props for basic setup