Height Modes¶
Buckaroo controls grid height at two levels: the outer container (the
embed footprint in your page) and component_config.dfvHeight (the pixel
height of the AG Grid viewport inside). Getting them to match is the key to a
well-sized widget.
The interactive demo below walks through every height configuration — click a button to switch modes and read the explanation panel.
The demo is a single-page app — multiple Buckaroo instances share the
same DOM (no iframes). Height modes that depend on
window.innerHeight behave exactly as they would in your
own embed.
How height is decided¶
heightStyle() in gridUtils.ts runs on every render:
Special environments (Google Colab, VS Code, tiny iframe) → always
height: 500, domLayout: "normal".``component_config.dfvHeight`` — explicit pixel height. Overrides
height_fraction. Absent:dfvHeight = window.innerHeight / (height_fraction || 2).``autoHeight`` prop on
BuckarooServerView/DFViewerInfiniteDS—truestampslayoutType: "autoHeight";falsestamps"normal";undefined(default) lets Buckaroo auto-detect. See The autoHeight prop (issue #862).Auto-detect (shortMode) — if
numRows + pinnedRowLenfits without a scrollbar, grid switches todomLayout: "autoHeight"automatically.
Quick reference¶
Config |
Mode |
When to use |
|---|---|---|
No |
auto-detect |
Let Buckaroo decide; works for most cases |
|
normal |
Fixed-height panel, predictable across screen sizes |
|
normal |
Proportional to the browser window; good for full-page embeds |
|
autoHeight |
Force grow-to-content even for large datasets |
|
normal |
Force fixed height even for small datasets |
|
normal |
Override a server-sent |
The autoHeight prop (issue #862)¶
Before version 0.14.9, passing autoHeight={false} to
BuckarooServerView had no effect: the server’s
component_config.layoutType always won. The prop now takes precedence:
// Force normal mode regardless of what the server sends:
<BuckarooServerView
wsUrl="ws://localhost:8700/ws/my-session"
autoHeight={false}
/>
// Force autoHeight (grow to content):
<BuckarooServerView wsUrl="..." autoHeight={true} />
// Undefined (default): server value wins.
<BuckarooServerView wsUrl="..." />
The same prop is available on DFViewerInfiniteDS for static embeds.