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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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, 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
자주 묻는 질문
어떤 라이브러리를 쓸 수 있나요?
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.
댓글
- …
이 저장소의 다른 스킬
depot-ci
41k에이전트가 GitHub Actions 대안인 Depot CI 워크플로를 설정하고 실행하도록 돕습니다. 기존 워크플로 이전과 실행 로그 읽기를 포함합니다.
depot-container-builds
41k에이전트가 Depot 원격 빌더에서 Docker 이미지를 빌드하도록 돕습니다. 다중 플랫폼 이미지, 레지스트리 푸시, 빌드 실패 수정을 포함합니다.
depot-github-runners
41k에이전트가 GitHub Actions 작업을 Depot 관리형 러너로 옮기고, 러너 크기와 라벨을 고르도록 돕습니다.
editing-agents-md
41k에이전트가 규칙을 AGENTS.md나 CLAUDE.md 중 어디에 둘지 정하고, 파일을 키우지 않으면서 잘 지켜지도록 쓰게 돕습니다.
비슷한 스킬
angular-developer
280k에이전트가 Angular 코드를 만들고 프로젝트 구조를 조언하도록 돕습니다. 새 프로젝트 시작, 코드 부분 생성, 성능과 접근성 개선에 유용합니다.
frontend-a11y
280k모든 사람이 웹 인터페이스를 쓸 수 있도록 에이전트를 돕습니다. 웹사이트와 앱이 화면 읽기 프로그램과 키보드 탐색에서 잘 작동하도록 합니다.
frontend-patterns
280k프론트엔드 개발의 현대적인 패턴을 적용하도록 에이전트를 돕습니다. React와 Next.js에서 성능을 최적화하고, 상태를 관리하며, 모범 사례를 따릅니다.