Template
Donut chart widget for MCP Apps
How a total splits into parts, drawn as an animated donut with Chart.js. The model sends labels and values; the widget adds up the total and works out every share.
Uses Chart.js
Can you break down last month's team spending by category?
Used show_donut_chart
The house design: black outline, butter yellow and a marker swipe under the title.
The data it takes
| Field | Type | What it is |
|---|---|---|
| titlerequired | string | |
| subtitle | string | |
| unit | string | Shown under the total |
| segmentsrequired | object[] | |
| └ labelrequired | string | |
| └ valuerequired | number | |
| └ color | string | Any CSS color. Leave it out to use the design palette. |
Sample data
{
"title": "Spending by category",
"subtitle": "September 2026",
"unit": "€ in total",
"segments": [
{
"label": "Software",
"value": 1840
},
{
"label": "Training",
"value": 960
},
{
"label": "Travel",
"value": 720
},
{
"label": "Equipment",
"value": 410
}
]
}The tool that shows it
A widget made from this template is shown by one tool. The model reads its description to decide when to call it and fills the input schema with the data. This is the definition Widgetry exports:
{
"name": "show_donut_chart",
"title": "Donut",
"description": "Shows how a total splits into parts as a donut chart with a legend and the total in the middle. Use it for shares such as spending by category, traffic by source or time by project.",
"inputSchema": {
"type": "object",
"required": [
"title",
"segments"
],
"properties": {
"title": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"unit": {
"type": "string",
"description": "Shown under the total"
},
"segments": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"label",
"value"
],
"properties": {
"label": {
"type": "string"
},
"value": {
"type": "number",
"minimum": 0
},
"color": {
"type": "string",
"description": "Any CSS color. Leave it out to use the design palette."
}
}
}
}
}
}
}More templates
- BoardColumns of cards with labels, dates and people. Like a Trello board.
- Aurora cardA featured announcement with a headline, a figure and a button, dressed differently by each design.
- 3D globeA WebGL globe with three.js that spins on its own and can be dragged, with a dot per place.
- WeatherThe weather for a place with animated SVG icons and the coming hours; each design paints its own sky.
- Progress ringsGoals as SVG rings that fill up as they appear, with their percentage.
- Area chartA series over time as an SVG curve with a gradient fill that draws itself in.
- 3D carouselCards on a ring that spins in 3D with CSS perspective. Pauses on hover.
- CountdownDays, hours, minutes and seconds to an event, ticking live with a little jump.
- MilestonesFigures that count up from zero and cascade in, animated with GSAP.
- MetricsA row of key figures with their change against the previous period.
- Bar chartHorizontal bars with their values, in the order they arrive.
- TableRows and columns with a sticky header; the caller decides the columns.