Customization
Last updated
Last updated
You can customize everything. Really everything. But it doesn't has an option
to do "everything". That's why the library has class for every state (loading, selected and so on).
The props theme
is essentially a class for a container. This makes it very easy to set your styles for the tree.
Example how to set a theme:
There are 3 ready-made themes for use
arrowRenderer
checkboxRenderer
textRenderer
It can be either class (React Component) or function. It receives a node
object in the props. Let's see the example of the usage.
You have to add styles for DOM nodes (except of textRenderer
) by yourself. Its parent has display: flex CSS property.
They have classNames:
for checkboxRenderer - node-checkbox-overrided
for arrowRenderer - node-arrow-extended
The node has a very simple structure.
checkable mode
For non checkable mode .node-checkbox
will not shown in the DOM
For nodes which doesn't has children .node-arrow
className will be replaced to .node-noop