본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)41k · #6840

building-react-quill-canvases

하는 일

이 스킬은 React와 PostHog 자체 디자인 시스템을 사용해 대시보드, 데이터 보드, 도구 같은 대화형 캔버스를 만듭니다. PostHog의 모습과 맞는 앱 같은 캔버스를 원하는 사람을 위한 것입니다.

사용하는 경우

  • ✓PostHog 안에 대화형 대시보드나 데이터 보드를 원할 때.
  • ✓버튼과 입력이 있는 양식, 도구, 앱 스타일 캔버스가 필요할 때.
  • ✓캔버스가 밝은 테마와 어두운 테마 모두에서 PostHog의 모습과 맞아야 할 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-react-quill-canvases/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/canvas/skills/building-react-quill-canvases/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“체험 사용자를 위한 날짜 선택기와 지표 카드 세 개가 있는 대화형 캔버스를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 PostHog가 마운트하는 React 컴포넌트 하나를 작성하고, 허용된 컴포넌트와 import를 사용합니다. 각 데이터 카드를 따로 불러오고, 테마와 로딩 상태를 PostHog 디자인과 일관되게 유지합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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, 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 (e.g. <PopoverTrigger render={<Button …/>} />) instead of wrapping it.
  • Quill components are already themed — never restyle one with Tailwind classes or inline style; use their variant/size props. 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 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
자주 묻는 질문

어떤 라이브러리를 쓸 수 있나요?

React, Quill, Recharts, Lucide, Day.js 같은 표준 라이브러리와 짧은 선택 목록의 라이브러리를 쓸 수 있습니다. 다른 import는 검증에 실패합니다.

캔버스가 모든 데이터를 기다렸다가 보여 주나요?

아니요. 각 카드는 자기 데이터가 도착하는 대로 채워집니다.

인터넷의 아무 패키지나 쓸 수 있나요?

아니요. 허용 목록 밖의 import는 검증에 실패하므로, 승인된 라이브러리만 쓸 수 있습니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
41k
순위
#6840
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬