Overview — Dashboard block

Free

dashboard-overview · for app, home pages

Overview

An app’s home read from the top: the figures, then the chart, then the lists side by side

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-overview

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import DashboardOverview from '@/components/trame/blocks/dashboard/dashboard-overview.vue'

const props = {
title: "Good morning, Priya",
intro: "Kitebase this week: traffic, revenue and what needs a look.",
period: "October 2 – 8",
actions: [
{
label: "Create an API key",
action: "key.create"
},
{
label: "Invite a teammate",
action: "member.invite"
}
],
figures: [
{
label: "Monthly recurring revenue",
value: 18420000,
format: "money",
delta: 6.2,
deltaTone: "success",
deltaLabel: "vs. previous week",
series: [
158,
163
],
open: "report.revenue"
},
{
label: "Inference calls",
value: 8940000,
format: "number",
delta: 12.8,
deltaTone: "success",
deltaLabel: "vs. previous week",
series: [
1.08,
1.12
],
open: "report.usage"
}
],
chart: {
title: "Inference calls by day",
subtitle: "All regions, all models",
kind: "bars",
format: "number",
seriesLabel: "Calls",
open: "report.usage",
points: [
{
x: "Mon",
y: 1080000
},
{
x: "Tue",
y: 1120000
}
]
},
lists: [
{
id: "todo",
title: "Needs a look today",
role: "attention",
total: 6,
open: "alert.show",
more: "alert.list",
items: [
{
id: "i-311",
title: "Latency above 800 ms on eu-west",
detail: "GPU pool at 92% for 14 minutes",
meta: "Now",
badge: {
label: "Incident",
tone: "danger"
}
},
{
id: "b-2207",
title: "Card declined: Harbor Analytics",
detail: "Scale plan · second attempt tomorrow",
meta: "Today",
badge: {
label: "Billing",
tone: "warning"
}
}
]
},
{
id: "latest",
title: "New workspaces",
role: "recent",
total: 1386,
open: "workspace.show",
more: "workspace.list",
items: [
{
id: "w-1386",
title: "Tidewater Robotics",
detail: "Scale plan · 14 seats",
meta: "$1,200.00",
badge: {
label: "Paid",
tone: "success"
}
},
{
id: "w-1385",
title: "Lantern Health Labs",
detail: "Team plan · 6 seats",
meta: "$390.00",
badge: {
label: "Paid",
tone: "success"
}
}
]
}
],
options: {
currency: "USD",
mood: "inverse"
}
}
</script>

<template>
<DashboardOverview v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe app’s home, as it greets its user ("Hello Camille")
introstringWordsone line under the title ("Here is where the workshop stands")
periodstringWordsthe period the figures and the chart cover, as the host wrote it ("1 to 7 October")
actionsAction[]frequent creations offered as buttons, e.g. "New order"
figuresFigure[]the key figures, up to twelve
chartCharta chart of one figure over time
listsList[]short lists of records to act on
loadingbooleanthe figures and lists are being fetched: placeholders in the layout’s shape, the header and its actions still usable
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Action actions[] · 3 props
PropTypeDescription
label*stringWordsthe frequent creation ("New order")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
Figure figures[] · 11 props
PropTypeDescription
label*stringWordswhat the figure counts ("Paid orders")
value*number | nullDatathe figure as the server counted it: cents for money, null when unknown
format'number' | 'money' | 'percent'how the figure reads: a number, money (cents) or a percent
unitstringWordsthe unit written after a number ("orders")
periodstringWordsthe period this figure covers, if it differs from the dashboard’s ("Today")
deltanumberDatathe change the server gives, in percent and signed (+12.4, -3): never computed by the block
deltaTone'neutral' | 'info' | 'success' | 'warning' | 'danger'how the server reads that change: a rise in returns is not good news
deltaLabelstringWordswhat the change compares to ("vs previous week")
seriesnumber[]Datathe last points of the figure, oldest first, to draw its small line
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'the state the host reads in the figure
openstringActionwhere the figure leads: the records behind it
Chart chart · 8 props
PropTypeDescription
title*stringWordswhat the chart shows ("Revenue per day")
subtitlestringWordsthe period or the unit, one line
kind*'bars' | 'line'bars: separate periods; line: a continuous trend
format'number' | 'money' | 'percent'how the values read: a number, money (cents) or a percent
seriesLabelstringWordswhat the values are ("Sales")
points*Point[]Datathe values by period, oldest first; cents when money
readingstringWordsone sentence reading the chart, written by the merchant or the host: the block never writes it
openstringActionthe full report
Point chart.points[] · 2 props
PropTypeDescription
x*stringthe point’s label on the axis, e.g. a day
y*number | nullthe value at this point; null when unknown
List lists[] · 8 props
PropTypeDescription
id*stringDesignthe list’s key
title*stringWordswhat the list holds ("To handle", "Latest orders")
role'attention' | 'recent'attention: what needs an answer now; recent (the default): the latest records
totalnumberDatahow many records there are in all, counted by the server
items*Item[]Dataa few rows: id, title, a detail line, a trailing meta (date, amount) and a badge with the host’s tone
openstringActionwhat a row runs, with the item as record
morestringAction"See all": the full list
emptystringWordswhat the list says when it is empty ("Nothing to handle today")
Item lists[].items[] · 5 props
PropTypeDescription
id*string | numberthe item’s id
title*stringthe item’s title
detailstringa second line under the title
metastringa short fact at the end of the row, e.g. a date
badgeBadgea status badge on the item
Badge lists[].items[].badge · 2 props
PropTypeDescription
label*stringthe badge’s name, as shown
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'the status colour
Options options · 3 props
PropTypeDescription
currencystringDesignISO 4217 for money figures, euro by default
emptystringWordswhat the page says when it has nothing to show
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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
  • Asks your app through actions: actions[], figures[].open, chart.open, lists[].open, lists[].more
  • Reads figures, lists from your app

A dashboard section, for app, home pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More dashboard blocks

  • 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.
  • 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.
  • Project card member: A person-led summary with counters and contact entry, using the merchant's own records only.
  • Project card mini: A compact title, progress and figure for a dashboard, using the merchant's own records only.
  • Project card: A project summary with figure, progress and team, using the merchant's own records only.
  • Report breakdown: The merchant’s own breakdown table leads beside a written reading, with charts as supporting evidence below.

All 20 dashboard blocks