building-react-quill-canvases
What it does
This skill builds interactive canvases, such as dashboards, data boards and tools, using React and PostHog's own design system. It is for people who want an app-like canvas that matches PostHog's look.
When to use it
- βWhen you want an interactive dashboard or data board inside PostHog.
- βWhen you need a form, tool or app-style canvas with buttons and inputs.
- βWhen a canvas must match PostHog's look in both light and dark themes.
Skill link
https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-react-quill-canvases/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βBuild an interactive canvas with a date picker and three metric cards for trial users.β
5 new skills a week. 1 minute to read.
How it works
The AI writes one React component that PostHog mounts, uses the allowed components and imports, and loads each data card separately. It keeps the theme and loading states consistent with PostHog's design.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Building React + Quill canvases
The whole application is one React/TSX file (src/canvas.tsx in the source project). It must
export default a single React component that takes no props β the host mounts it. Do not import
react-dom or call createRoot.
Start from the working scaffold in references/starter-scaffold.md
on a first build: it already wires the date picker, theme tokens, per-query loading state (every
card fills in independently as its own data lands), and correct typed-node result reading. Keep
that wiring; replace the sample metrics and layout.
Keep its pattern of one component per card with editable() params, and follow the "Params" section of the building-canvases skill for each card you add.
Imports
Use React, Quill, Recharts, Lucide, and Day.js for the standard application shell. The platform also admits ten optional libraries for specialized work. Read references/platform-libraries.md before choosing one.
PostHog data comes through import { ph } from "@posthog/canvas-sdk" β a platform-provided
module, so it needs no dependencies entry. The same object exists as the window.ph global
(how existing canvases reach it); prefer the import in new code.
Other bare imports, dynamic import(), require(), <script> tags, and remote code fail
validation. Direct network requests and external images, fonts, media, or frames require an exact
HTTPS origin in capabilities.network.origins. They work only in the published canvas β the
edit-mode preview blocks direct network access regardless of declaration. Stylesheets from declared
origins are allowed; remote scripts remain blocked, so bundle code with the canvas.
Quill component rules
A PostHog data board must be built entirely from @posthog/quill components β never a native
control or a styled <div> standing in for one:
- Dropdown/picker β
Select(never a native<select>); button βButton(never<button>); text field βInput/Textarea; checkbox βCheckbox; label βLabel. - Table β
Table(TableHeader>TableRow>TableHead, thenTableBody>TableRow>TableCell); panel βCard(CardHeader+CardTitle+CardContent); pill βBadge; titles βHeading; body βText. - A
Tableinside aCardneeds<Card size="sm" flush>around<Table size="sm" fullWidth>. Withoutflushthe card's padding insets the table, so its header and rows stop meeting the card's edges.flushdrops the card's section gap, bottom padding, and theCardContentinline padding, while the header keeps its own padding and divider. Matchingsize="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 andrechartselements. - Quill is built on Base UI: compose compound parts (
Select+SelectTrigger/SelectContent/SelectItem), use controlledvalue+onValueChange, and swap a part's element with therenderprop (e.g.<PopoverTrigger render={<Button β¦/>} />) instead of wrapping it. - Quill components are already themed β never restyle one with Tailwind classes or inline
style; use theirvariant/sizeprops. Put layout utilities (flex,grid,gap-4,p-4) on your own wrapper<div>s. - Buttons: default to
variant="outline";variant="primary"for the one main action only.
Styling and theme
- 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 useh-screenthere: a fixed viewport height caps a flex column, so tall children shrink and clip instead of scrolling. Do not useh-fullthere either: a published canvas's artifact shell gives itshtml,body, and#rootelements 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-heightroot is not a definite height, soh-fullon 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
stylefor genuinely dynamic runtime values (fixed sizes use arbitrary-value utilities likeh-[280px]). - Write specific interface copy. Never use lorem ipsum or placeholder labels in a finished
FAQ
Which libraries can it use?
Standard libraries such as React, Quill, Recharts, Lucide and Day.js, plus a short list of optional ones. Other imports fail validation.
Does the canvas wait for all data before showing anything?
No. Each card fills in as its own data arrives.
Can it use any package from the internet?
No. Imports outside the allowed list fail validation, so only approved libraries can be used.
Details
Original description by the author
Author the React + Quill implementation of a PostHog canvas: the single-component contract, the allowed imports, Quill (PostHog's design system) component and composition rules, theme-aware design tokens, loading skeletons, and the in-canvas date picker. Use after building-canvases has routed a canvas request to a React implementation β dashboards, data boards, forms, tools, or any canvas that should look native to PostHog.
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6840
- License
- β
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
angular-developer
280kHelps your agent create Angular code and give project structure advice. Useful for starting new projects, creating code parts, or improving performance and accessibility.
frontend-a11y
280kHelps your agent make web interfaces accessible to everyone. It ensures websites and apps work well with screen readers and keyboard navigation.
frontend-patterns
280kHas your agent apply modern patterns in frontend development. It optimizes performance, manages state, and follows best practices in React and Next.js.