Showcase

Blazor Mind Map

The Blazor Bootstrap Mind Map component shows hierarchical data as a collapsible node-link tree that grows right, left, to both sides, down, or up. The examples below cover directions, node template, branch colors, expansion and selection and path.
API Documentation
INFO
On a prerendered or static page, MindMap first shows the tree read-only. The +/− controls, find box, zoom, and keyboard support start once the page is interactive.

Basic usage #

MindMap draws one root item and its descendants as a collapsible node-link tree, with a line from each parent to each child.
How to use:
  1. Add MindMap and set TItem to your item type.
  2. Set Root to the central item.
  3. Set Children to a selector that returns an item's children, and Label to a selector that returns its text.
  4. Name the map for screen readers with aria-label or aria-labelledby.
Click + or − on a card to open or close it. By default only the root starts open.

Directions #

Branches grow to the right by default. Direction can make them grow left, to both sides of a central root, down, or up.
How to use:
  1. Set Direction to a MindMapDirection value: Right, Left, BothSides, Down, or Up.
  2. With BothSides, first-level branches are split between the right and left so both sides hold a similar number of nodes.
Pick a direction below to see the same plan laid out each way.

Node template #

NodeTemplate fills each card with your own markup. The component still draws the card frame, the +/− control, and the lines.
How to use:
  1. Add a NodeTemplate and name its context, for example Context="node".
  2. Read the item from node.Item and render any markup, such as Badge components.
  3. Keep Label set: search, the path bar, and screen readers use it.
This API map shows each type's kind, member count, review tags, open issues, and a status dot.

Branch colors #

Each first-level branch takes the next Bootstrap palette color, and its descendants share it. Your data can pin a color for any branch.
How to use:
  1. Leave AutoBranchColors on for automatic colors, or set it to false for neutral lines.
  2. Set BranchColor to a selector that returns a MindMapColor for an item, or null to keep the automatic color.
Here Risks is pinned to red, and the switch turns automatic colors off.

Expansion #

Bind the open nodes to read, set, save, or restore them, and react to each change.
How to use:
  1. Bind the open nodes with @bind-ExpandedItems. Without a binding, InitialExpandDepth decides which nodes start open.
  2. Call ExpandAllAsync() or CollapseAllAsync() through a component reference.
  3. Handle OnExpandedChanged to see which nodes opened and closed in each change.
The lines under the map show the bound set and the last change.

Selection and path #

Clicking a card, or pressing Enter or Space on it, selects it. The path bar under the map shows the way from the root to the selected node.
How to use:
  1. Bind the selected item with @bind-SelectedItem.
  2. Use the selected item to show details elsewhere on the page.
  3. Set ShowPath="false" to hide the path bar.
Selecting a node does not open or close it. Only the +/− control does that.
The find box matches node labels, opens every branch that leads to a match, and marks the matching cards.
How to use:
  1. Type in the find box. Matching is case-insensitive and uses the Label text.
  2. In a NodeTemplate, use node.IsMatch and node.SearchText to mark the matching text yourself.
  3. Set AllowSearch="false" to hide the find box.
Try searching for Table.

Zoom and pan #

Large maps scroll inside their own frame. Zoom out to see more of the map, and drag the background to move it.
How to use:
  1. Use the − and + buttons to zoom between 50% and 150%, and Reset zoom to return to 100%.
  2. Drag the map background with a mouse or pen to pan. On touch screens, scroll as usual.
  3. Change the frame's maximum height with the --bb-mind-map-max-height CSS variable.
Zoom controls are hidden in browsers that do not support the CSS zoom property.

Hide built-in features #

Search, zoom, panning, and the path bar are on by default. Turn off the ones a small map does not need.
How to use:
  1. Set AllowSearch, AllowZoom, AllowPan, or ShowPath to false.
This map shows only the tree.

Stack leaves #

In the Down and Up directions, siblings sit side by side, so wide maps grow quickly. Stacking lists leaf children in a column instead.
How to use:
  1. Set Direction to MindMapDirection.Down or MindMapDirection.Up.
  2. Set StackLeaves="true". A node whose two or more children are all leaves then lists them in a column.
Turn the switch off to see the classic side-by-side layout.

Dynamic data #

When your data changes, the map shows the new tree. Open and selected items that still exist stay open and selected; removed items leave both bindings.
How to use:
  1. Change the children your Children selector returns.
  2. Re-render the page, which happens automatically after a button click.
Open or select Build, then remove it to see the bindings update.

Large tree #

MindMap keeps all data in memory and stays responsive with hundreds of open nodes.
How to use:
  1. Pass the whole tree through Root and Children.
  2. Use InitialExpandDepth to choose how much opens at first, and ExpandAllAsync() to open everything.
This map lists every Blazor Bootstrap component and its parameters.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.