What problem does it solve?
Building a PostHog canvas that looks and behaves natively requires knowing many non-obvious rules: the single-component export contract, which imports are allowed, how Quill components must be composed, theme-aware design tokens, per-query loading states, and the in-canvas date picker. This Skill encodes all of those rules so the generated canvas passes validation and matches PostHog's design system on the first build.
Core Features & Use Cases
- Single-component contract and import rules: Enforces one default-exported React component in
src/canvas.tsx, the allowed import set (React, Quill, Recharts, Lucide, Day.js, plus ten optional pinned libraries), and the @posthog/canvas-sdk ph module for data access.
- Quill composition and theming rules: Mandates Quill components over native controls, Base UI composition patterns (
render prop, controlled value/onValueChange), design-token-only coloring, and correct status-token usage (bg-success vs text-success-foreground).
- Progressive loading, error, and empty states: Requires per-query loading skeletons, visible error states with retry, and a strict separation between failed queries and empty results.
- Use Case: After the building-canvases router selects a React implementation for a product dashboard request, use this Skill to scaffold the canvas from the starter reference, wire the DateTimePicker in a Popover, fire concurrent
ph.query calls per card, and render KPI cards, a Recharts line chart, and a web analytics table that all match the user's PostHog theme.
Quick Start
Build a React + Quill canvas for a product dashboard with KPI cards, a date range picker, and per-card loading skeletons starting from the starter scaffold reference.