Goal progress target line — Dashboard block
Prodashboard-goal-progress-target-line · for app, analytics, billing pages
Goal progress target line
The road to a goal: each measure over time as a line under its dashed target, the band above the target tinted, when how it got there matters
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/dashboard-goal-progress-target-lineUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import DashboardGoalProgressTargetLine from '@/components/trame/blocks/dashboard/dashboard-goal-progress-target-line.vue'
const props = {
title: "Revenue by channel",
subtitle: "May through October, in dollars",
reading: "Online sales have been growing since August, while markets are slowing as the season ends.",
headline: {
label: "6-month total",
value: "$45,860",
delta: "+8.1%",
deltaLabel: "vs. previous 6 months",
tone: "success"
},
series: [
{
id: "web",
label: "Online store",
points: [
{
x: "May",
y: 412000
},
{
x: "Jun",
y: 438000
}
]
},
{
id: "market",
label: "Markets",
points: [
{
x: "May",
y: 186000
},
{
x: "Jun",
y: 204000
}
]
}
],
target: [
{
id: "web",
value: 600000
},
{
id: "market",
value: 200000
}
],
options: {
yFormat: "money",
currency: "USD"
}
}
</script>
<template>
<DashboardGoalProgressTargetLine v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the chart shows ("Revenue per month") |
| subtitle | string | Wordsthe period or the unit, one line |
| reading | string | Wordsone sentence reading the chart, written by the merchant or the host: the block never writes it |
| headline | Headline | the headline figure above the chart |
| series* | Sery[] | Datathe series over the same categories; amounts in cents when yFormat is money; at most 60 points (downsample on the server) |
| target* | Target[] | Datathe goal of each series |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Headline headline · 5 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the figure is ("Total over 6 months") |
| value* | string | Wordsthe figure, formatted by the host |
| delta | string | Wordsits change, formatted and signed by the host ("+8.1%") |
| deltaLabel | string | Wordswhat it compares to ("vs previous period") |
| tone | 'neutral' | 'success' | 'warning' | 'danger' | how the host reads the change |
Sery series[] · 3 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe series’ key |
| label* | string | Wordswhat the series counts ("Online shop") |
| points* | Point[] | the series’s points, in order |
Point series[].points[] · 2 props
| Prop | Type | Description |
|---|---|---|
| x* | string | Wordsthe category or period ("May") |
| y* | number | null | the value at this point; null when unknown |
Target target[] · 2 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe series it is the target of |
| value* | number | the target value |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| yFormat | 'number' | 'money' | 'percent' | how the values read: a number, money (cents) or a percent |
| currency | string | DesignISO 4217 for money, the app’s by default |
| empty | string | Wordswhat a chart with no data says |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| money | formats a price, given in cents |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Reads
seriesfrom your app
A dashboard section, for app, analytics, billing pages; it uses @lucide/vue.
More dashboard blocks
- Day briefing beside: A day briefing beside bookable slots supplied by the merchant, for reception and appointment booking.
- Focus: what needs an answer today comes first and large, the figures a quiet strip under it, the chart and the latest records after.
- Leaderboard podium: a team page or a monthly review where the top three matter: three raised tiles, the first in the middle, the rest as rows under them.
- Leaderboard ranked rows: a dashboard card of 3 to 10 entries: rank, avatar, name, the value right-aligned and its signed change.
- Leaderboard table: a long ranking of 12 or more to scan and compare: rank, name, value, change and share columns, the viewer’s own row pinned when outside the top ten.
- Metric tabs: one big chart for several measures: the chart and every figure with its own points become selectable tiles over a single plot, the other figures a quiet strip and the lists two columns under it.
- Overview: an app’s home read from the top: the figures, then the chart, then the lists side by side.
- Project card member: A person-led summary with counters and contact entry, using the merchant's own records only.