adding-dashboard-v2-custom-content
БесплатноБез исполняемых скриптовНе проверенGuides putting a product's own React component in a dashboards v2 tile through the custom panel type: a content package in the product's folder…
от PostHog★ 41 278 звёзд на GitHubОб этом скилле
Adding custom content to a dashboards v2 tile
A custom content is a product's own React component shown in a tile.
The tile draws the frame (title, menu, error boundary), and the document saves only the content's name, such as { type: 'custom', config: { content: 'web-analytics/browser-filter' } }.
Read products/dashboards_v2/.agents/composing.md ("Your own component in a tile") and .agents/primitives.md first.
Decide it is custom content
- The component draws the result of a query as a chart, number or table: make it a chart kind instead, as
composing.mddescribes in "Your own kind of chart". Charts get sample data, filters, image export and the chart menu for free. - It is not a query result, or it needs its own interaction, such as a setup prompt, a checklist, a list with actions or a control that changes the dashboard's filters: make it custom content.
Migrate a component
Find or create the product's package. One per product, in that product's own folder, such as
products/web_analytics/frontend/dashboard/webAnalyticsContents.ts(use/placing-product-frontend-codewhen unsure). The namespace is the product's name in kebab case. It is saved in every document that uses the content, so pick it once and never rename it.Add the content with a short name.
const BrowserFilter = lazy(() => import('./BrowserFilter').then((module) => ({ default: module.BrowserFilter }))) export const webAnalyticsContents = defineContentPackage('web-analytics', { 'browser-filter': { Component: BrowserFilter, size: { w: 8, h: 8, minW: 6, minH: 6 } }, })Load the component with
React.lazy, so code that only checks documents never loads it. The name is saved in documents too: renaming one breaks saved dashboards.Decide what the tile sets. A value that differs between two tiles of the same content, such as which service a list shows, is a prop: wrap the content in
defineContentwith apropsSchema(az.strictObject), and the tile saves the values inconfig.props. The prop names are saved in documents, so renaming one breaks saved dashboards. Everything else is not a prop:- Data it loaded from its scene's props or logic comes from a logic keyed on what the component can read itself, such as the current team.
- The dashboard's time range and filters come from
FiltersContext. - A control that changes them uses the controllers in
FilterControlsContext. Each is missing when the dashboard has none, so disable the control with adisabledReasonthen. - Never read
DashboardStateContextor a context from the page the component came from.
Strip its own frame. Remove the component's card, border, padding that matches the card's, and its title. The tile draws them, and the tile's
titleholds the heading. Hide the tile header withparts: { header: false }when the content has its own, such as a callout.Fill the tile. The content gets the tile's height. A list or table scrolls inside itself, and nothing sets a fixed height. Pick
sizeso the default tile shows the content without a scrollbar.Give it a
Loadingshaped like the content when it loads data, so an off-screen tile looks like itself. Left out, the tile shows the default loading state.Opt in only to what the product wants people to do. By default a content cannot be moved and has an empty menu.
movable: truelets a person drag, resize, move and remove the tile.duplicable: trueadds Duplicate to the tile's menu.backgroundColor: trueadds Background to the tile's menu, whatevermenuActionsreturns. To color the tile from the component's own state instead, calluseTileBackground(color)with one ofTILE_BACKGROUND_COLORSor any CSS color.menuActions(actions, context)returns the built-in actions to show, such asactions.filter((action) => action.key === 'download'). Left out, the menu is empty.keepMounted: truekeeps the component mounted after it scrolls out of view. Set it when the component holds state a person would lose, such as a picked tab or a draft, and leave it out otherwise, because the tile then stays in memory.showOnInteractiveOnly: trueleaves the tile out of images and printed pages. Use it for prompts, buttons and live counters, which mean nothing in a snapshot.
Register the package in the host's panel list,
createCustomPanel({ packages: [webAnalyticsContents] }), and add the tile to the dashboard JSON. A product page passes only its own package: products never import another product's package.
Before you report done
- The tile renders on the host page, with no "not valid" message and no scrollbar at its default size.
- A content with a
propsSchemarenders from the props its tile saved, and a tile with a wrong prop shows the "not valid" message. - Every control works and changes the dashboard's filters or time range when it should.
- The tile has no drag han
Установить adding-dashboard-v2-custom-content в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл adding-dashboard-v2-custom-content?
Guides putting a product's own React component in a dashboards v2 tile through the custom panel type: a content package in the product's folder (`defineContentPackage`), `createCustomPanel({ packages })`, the off-by-default opt-ins (`movable`, `duplicable`, `backgroundColor`, `menuActions`, `showOnInteractiveOnly`) and reading or changing the dashboard's filters. Use when migrating an existing component, banner, list or prompt from a product page into a dashboards v2 tile, adding a new custom content, or reviewing a diff that touches a content package. Not for a new kind of chart or panel type (`adding-dashboard-v2-panel-types`).
Как установить скилл adding-dashboard-v2-custom-content?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл adding-dashboard-v2-custom-content запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic