What you’ll build
A simple “Project Pulse” widget that shows two KPIs and a list — the same structure used by most Radarboard widgets. By the end you’ll have a live widget in the sandbox.Prerequisites
- Radarboard dev environment running (
pnpm dev) - Terminal open in the project root
Step 1: Scaffold (30 seconds)
widgets/project-pulse/ with all boilerplate, registers it in radarboard.config.ts, and installs dependencies.
Step 2: Define your layout (2 minutes)
Openwidgets/project-pulse/index.ts and replace the starter recipe:
kpiRowcreates a row of headline numberslistrenders an array of items with title/subtitleSRCties sections to a data source by ID
capabilities if the widget owns or specializes an existing shared surface. Use requiredIntegrations only for availability filtering.
Step 3: Preview it (1 minute)
Open your browser to:- Happy Path — with auto-generated mock data
- Empty — all arrays empty, all numbers zero
- Loading — skeleton shimmer
- Error — error message overlay
Step 4: Connect real data (1 minute)
Create a data resolver inwidgets/project-pulse/src/hooks/use-project-pulse.ts:
What’s next?
- Add an expanded view: Create a
ProjectPulseExpandedcomponent for the detail overlay - Connect to integrations: Use
@radarboard/utils/api-routesto fetch from GitHub, Vercel, etc. - Add variants: Define multiple layout presets users can switch between
- Read the full guide: Build a Widget covers advanced topics like visual editors, custom components, and testing
Key concepts
| Concept | What it does |
|---|---|
| Recipe | Declares the widget layout as data — kpiRow, list, chart, etc. |
| Data Source | A resolver component that fetches data and calls onState() |
| Section Helpers | Shorthand functions that build section configs without verbose objects |
| Template Widget | The runtime renderer that turns your recipe + data into React components |
| Widget Sandbox | Dev tool at /debug/widget-sandbox for previewing all states |