Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(canvas): prevent tall canvas sections from shrinking (#101803)

Adam Leith67dbe0275f01
diff --git a/products/canvas/skills/building-html-canvases/SKILL.md b/products/canvas/skills/building-html-canvases/SKILL.md
index 0408ec28c852..8fb9d40d775a 100644
--- a/products/canvas/skills/building-html-canvases/SKILL.md
+++ b/products/canvas/skills/building-html-canvases/SKILL.md
@@ -37,11 +37,10 @@ build pipeline's dependency admission ships.
## Styling and theme without Quill
-- Size the outermost JSX/HTML element to the iframe viewport with `h-screen` or `height: 100vh`.
- Do not use `h-full` or `height: 100%` on that root: a published canvas's artifact shell gives
- its `html`, `body`, and `#root` elements no explicit height, so percentage height collapses to
- the content height. Descendants may use percentage height after the outermost element establishes
- the viewport height.
+- Size the outermost JSX/HTML element to the iframe viewport with `min-h-screen` or `min-height: 100vh`, so it fills the viewport and grows past it as content demands.
+ Do not use `h-screen` or `height: 100vh` there: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling.
+ Do not use `h-full` or `height: 100%` on that root either: a published canvas's artifact shell gives its `html`, `body`, and `#root` elements no explicit height, so percentage height collapses to the content height.
+ A `min-height` root is not a definite height, so a descendant's percentage height still collapses; give an intermediate wrapper an explicit height when a child must fill a box.
- Use Tailwind utilities and/or a `<style>` block (keyframes and complex selectors are fine).
- The host toggles a `.dark` class on the document root when the user's PostHog theme changes.
Define your colors as CSS variables under `:root { … }` with overrides under `html.dark { … }`,
diff --git a/products/canvas/skills/building-react-quill-canvases/SKILL.md b/products/canvas/skills/building-react-quill-canvases/SKILL.md
index 59809c973315..ed17f4a24c99 100644
--- a/products/canvas/skills/building-react-quill-canvases/SKILL.md
+++ b/products/canvas/skills/building-react-quill-canvases/SKILL.md
@@ -44,6 +44,10 @@ control or a styled `<div>` standing in for one:
text field → `Input`/`Textarea`; checkbox → `Checkbox`; label → `Label`.
- Table → `Table` (`TableHeader` > `TableRow` > `TableHead`, then `TableBody` > `TableRow` > `TableCell`);
panel → `Card` (`CardHeader` + `CardTitle` + `CardContent`); pill → `Badge`; titles → `Heading`; body → `Text`.
+- A `Table` inside a `Card` needs `<Card size="sm" flush>` around `<Table size="sm" fullWidth>`.
+ Without `flush` the card's padding insets the table, so its header and rows stop meeting the card's edges.
+ `flush` drops the card's section gap, bottom padding, and the `CardContent` inline padding, while the header keeps its own padding and divider.
+ Matching `size="sm"` on both lines the table's edge columns up with the card's title.
- The only non-Quill tags allowed are plain layout `<div>`s and `recharts` elements.
- Quill is built on Base UI: compose compound parts (`Select` + `SelectTrigger`/`SelectContent`/`SelectItem`),
use controlled `value` + `onValueChange`, and swap a part's element with the `render` prop
@@ -55,10 +59,12 @@ control or a styled `<div>` standing in for one:
## Styling and theme
-- Give the canvas's outermost element `h-screen` (`height: 100vh`) so it fills the iframe viewport.
- Do not use `h-full` there: a published canvas's artifact shell gives its `html`, `body`, and
- `#root` elements no explicit height, so a percentage root height collapses to content height.
- Nested elements may use `h-full` once their parent establishes a height.
+- Give the canvas's outermost element `min-h-screen` (`min-height: 100vh`) so it fills the iframe viewport and grows past it as content demands.
+ Do not use `h-screen` there: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling.
+ Do not use `h-full` there either: a published canvas's artifact shell gives its `html`, `body`, and `#root` elements no explicit height, so a percentage root height collapses to content height.
+- The root needs no `overflow-y-auto`: once it grows past the viewport the iframe's own document scrolls.
+- A `min-height` root is not a definite height, so `h-full` on a direct child still collapses to content height.
+ Give an intermediate wrapper an explicit height (`h-[280px]`) when a child must fill a box.
- Style with Tailwind utilities and Quill components; reserve inline `style` for genuinely dynamic
runtime values (fixed sizes use arbitrary-value utilities like `h-[280px]`).
- Write specific interface copy. Never use lorem ipsum or placeholder labels in a finished canvas.
diff --git a/products/canvas/skills/building-react-quill-canvases/references/checklist-example.md b/products/canvas/skills/building-react-quill-canvases/references/checklist-example.md
index be765faf511b..249e2e105a46 100644
--- a/products/canvas/skills/building-react-quill-canvases/references/checklist-example.md
+++ b/products/canvas/skills/building-react-quill-canvases/references/checklist-example.md
@@ -276,7 +276,7 @@ export default function Canvas() {
}
return (
- <div className="h-screen overflow-y-auto bg-background">
+ <div className="min-h-screen bg-background">
<div className="mx-auto flex w-full max-w-4xl flex-col gap-4 p-6">
<div className="flex flex-wrap items-start justify-between gap-3">
<div className="min-w-0">
diff --git a/products/canvas/skills/building-react-quill-canvases/references/starter-scaffold.md b/products/canvas/skills/building-react-quill-canvases/references/starter-scaffold.md
index 88da3f813415..7296170b1876 100644
--- a/products/canvas/skills/building-react-quill-canvases/references/starter-scaffold.md
+++ b/products/canvas/skills/building-react-quill-canvases/references/starter-scaffold.md
@@ -165,10 +165,11 @@ export default function Canvas() {
const anyLoading = events.loading || visitors.loading
return (
- // The canvas root must resolve height against the iframe viewport. The
+ // The canvas root fills the iframe viewport and grows past it as content
+ // demands, so tall sections scroll instead of shrinking. The
// chrome (heading, date picker, card frames) renders immediately — only
// the value inside each card waits, each for its own query.
- <div className="flex h-screen flex-col gap-4 overflow-y-auto p-6">
+ <div className="flex min-h-screen flex-col gap-4 p-6">
<div className="flex items-center justify-between">
<Heading size="xl" className="mb-4">
Canvas
diff --git a/products/canvas/skills/composing-grid-canvases/SKILL.md b/products/canvas/skills/composing-grid-canvases/SKILL.md
index 15c797a58971..407d22ae2111 100644
--- a/products/canvas/skills/composing-grid-canvases/SKILL.md
+++ b/products/canvas/skills/composing-grid-canvases/SKILL.md
@@ -73,12 +73,11 @@ Start from the complete, buildable project in [references/component-example.md](
`additionalProperties`, `items`, `enum`, `const`, `minimum`, `maximum`, `minLength`, `maxLength`,
`minItems`, `maxItems`, `format`. No `$ref`, no `pattern` — validation rejects them.
-- **Design responsively.** Give the component's root `h-screen` so it fills the placement iframe's
- viewport, and adapt the layout to any size the user drags: a 2×1 placement is a glanceable tile;
- a 6×4 is a full app surface. Do not use `h-full` on the root: a published component's artifact
- shell gives its `html`, `body`, and `#root` elements no explicit height, so `height: 100%`
- collapses to the content height. Render usefully at `minW`×`minH`, and treat `config` as the only
- per-placement input.
+- **Design responsively.** Give the component's root `min-h-screen` so it fills the placement iframe's viewport and grows past it as content demands.
+ Adapt the layout to any size the user drags: a 2×1 placement is a glanceable tile; a 6×4 is a full app surface.
+ Do not use `h-screen` on the root: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling.
+ Do not use `h-full` on the root either: a published component's artifact shell gives its `html`, `body`, and `#root` elements no explicit height, so `height: 100%` collapses to the content height.
+ Render usefully at `minW`×`minH`, and treat `config` as the only per-placement input.
Publish and wait for the build like any canvas — a component with no ready build cannot go live on
a grid.
diff --git a/products/canvas/skills/composing-grid-canvases/references/component-example.md b/products/canvas/skills/composing-grid-canvases/references/component-example.md
index 143f77461f9c..d60289ff0974 100644
--- a/products/canvas/skills/composing-grid-canvases/references/component-example.md
+++ b/products/canvas/skills/composing-grid-canvases/references/component-example.md
@@ -99,8 +99,8 @@ export default function WelcomeChecklist() {
const done = checked ? ITEMS.filter((item) => checked[item.id]).length : 0
return (
- // The component root must resolve height against its placement iframe viewport.
- <div className="flex h-screen flex-col gap-2 overflow-y-auto p-3">
+ // The component root fills the placement iframe viewport and grows past it as content demands.
+ <div className="flex min-h-screen flex-col gap-2 p-3">
<div className="flex items-baseline justify-between gap-2">
<Text weight="medium">Welcome to PostHog</Text>
{checked ? (
@@ -142,5 +142,5 @@ export default function WelcomeChecklist() {
- Imports only from the platform allowlist (`react`, `@posthog/quill`, `lucide-react`, `recharts`, `dayjs`).
- `ph` is a host-injected global — never import it, and feature-detect optional surfaces like `ph.state` so the widget degrades instead of crashing on an older runtime.
- Loading state renders a skeleton, never a blank; every async access has a `.catch` that lands in a renderable state.
-- Fill the placement iframe viewport (`h-screen`) and let content scroll; `h-full` cannot resolve
- on the root because the published artifact shell has no explicit height.
+- Fill the placement iframe viewport with `min-h-screen` and let the iframe document scroll.
+ `h-screen` caps the flex column, so tall children shrink and clip; `h-full` cannot resolve on the root because the published artifact shell has no explicit height.