fold_condition#
- treescope.rendering_parts.fold_condition(collapsed: RenderableTreePart | None = None, expanded: RenderableTreePart | None = None) RenderableTreePart [source]#
Builds a part that renders differently when collapsed or expanded.
- Parameters:
collapsed – Contents to render when parent is collapsed.
expanded – Contents to render when parent is expanded.
- Returns:
A renderable part that renders as
collapsed
when the parent is collapsed and asexpanded
when the parent is expanded.