DiagView
DiagView Layout Compare
← Hub

Per-Diagram Layout Control

Three different layout modes on a single page, each set with a single HTML attribute. Click Destroy DiagView above to see the bare diagrams, then restore.

⊙ Floating FAB ▬ Header bar ✕ Off (click-only)

Floating

floating
data-diagview-layout="floating" data-diagview-accent="#f59e0b"

Header

header
data-diagview-layout="header" data-diagview-accent="#6366f1"

Off

off
data-diagview-layout="off" data-diagview-accent="#10b981" // Click diagram to open fullscreen

Floating FAB

A circular action button hovers over the bottom-right corner. Minimally intrusive — ideal for embedded diagrams where you want controls available but out of the way.

Header Bar

A full-width toolbar appears above the diagram. All actions are always visible. Best for documentation pages where users expect a familiar toolbar.

Off (Click-only)

No toolbar rendered at all. The diagram is clickable and opens fullscreen. Perfect for tight layouts or when you want a completely clean embed.

Keyboard Reference

Every action is keyboard-accessible. No mouse required.

Zoom
+Zoom in
-Zoom out
Space / 0Reset & center
Pan
↑ ↓ ← →Pan diagram
ShiftFast pan
DragFree pan
Search
FOpen search
EscClear / close
Tools
MMeeting mode
RRotate 90°
LShare link

How it works

A single global initialization handles all diagrams, with optional per-element attribute overrides.

<script>
  // One global init — no layout specified
  DiagView.init({ showBranding: true });
</script>

<!-- Each element specifies its own layout via data attributes -->
<div class="diagram"
     data-diagview-layout="floating"
     data-diagview-accent="#f59e0b">
  <svg>...</svg>
</div>

<div class="diagram"
     data-diagview-layout="header"
     data-diagview-accent="#6366f1">
  <svg>...</svg>
</div>

<div class="diagram"
     data-diagview-layout="off">
  <svg>...</svg>
</div>