prongs
GitHub

layout.chart

A chart: a trend over time, a breakdown. Renders <figure>; put the chart's svg or canvas inside with a height, and a text.caption that says what it shows

Component

Renders

<figure>

Profile

Comes from

Read https://www.prongs.dev/docs/intents/layout/chart.md and tell me whether layout.chart fits what I am building.

Example

Preview

Sign-ups per week, last two months

<Layout intent="layout.chart">
…
</Layout>

Connections

Choosing between neighbours

  • If it is

    Use

  • A chart: a trend over time, a breakdown. Renders <figure>; put the chart's svg or canvas inside with a height, and a text.caption that says what it shows

    layout.chart
  • A single number

    text.stat
  • An amount shown as blocks, like a battery

    layout.blocks
  • A smooth amount where small differences matter

    rather than layout.blocks
    layout.chart

For registry authors

Pack intent. prongs add dashboard puts the dashboard pack’s intents in your registry. They are then yours like the starter intents: rename, restyle and add to them, and see them with prongs add gallery.

What this intent is built from and its entry in components/prongs/registry.ts. You only need this to change how it looks or to add an intent like it.

How layout.chart resolves, and its definition

Each layer adds to the one before it; a later class wins over an earlier one that sets the same thing.

  • arrange.stack

    Children in a column, free to shrink inside a row or grid

    flex min-w-0 flex-col
  • layout.chart

    A chart: a trend over time, a breakdown. Renders <figure>; put the chart's svg or canvas inside with a height, and a text.caption that says what it shows

    m-0 min-w-0 gap-2
Final classes
flex flex-col m-0 min-w-0 gap-2
Definition
TS
'layout.chart': {
kind: 'semantic',
description: 'A chart: a trend over time, a breakdown. Renders <figure>; put the chart\'s svg or canvas inside with a height, and a text.caption that says what it shows',
refs: ['arrange.stack'],
binding: { element: 'figure', classes: 'm-0 min-w-0 gap-2' },
notFor: [
{ context: 'a single number', instead: 'text.stat' },
{
context: 'an amount shown as blocks, like a battery',
instead: 'layout.blocks',
},
],
},