Project card mini — Dashboard block

Pro

dashboard-project-card-mini · for app pages

Project card mini

A compact title, progress and figure for a dashboard, using the merchant's own records only.

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-project-card-mini

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import DashboardProjectCardMini from '@/components/trame/blocks/dashboard/dashboard-project-card-mini.vue'

const props = {
title: "The project at a glance",
record: {
id: "carnet",
title: "The materials notebook",
description: "A shared space to document the workshop’s trials.",
figure: {
label: "Phase",
value: "Preparation"
},
progress: 0,
person: {
name: "Camille Morel",
role: "Workshop coordinator"
},
team: [
{
name: "Camille Morel"
},
{
name: "Lou Perrin"
}
]
},
open: "project"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
record*Record | nullDatathe record the action applies to, passed to the host with it, if any
openstringActiona named action of the page
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Record record · 11 props
PropTypeDescription
id*stringDatathe record’s id
title*stringWordsthe record’s title
clientstringWordsthe client
descriptionstringWordsthe record’s description
figure*Figurethe key figure, a label and a value
progress*numberhow far along it is, 0 to 100
personPersonthe person in charge
teamTeam[]Datathe people on it
statusstringWordsthe record’s status, in the host’s words
datesDate[]key dates, each a label and a value
countersCounter[]counts shown on the card, each a label and a number
Figure record.figure · 2 props
PropTypeDescription
label*stringWordswhat the value is about
value*stringWordsthe value, as the merchant states it
Person record.person · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Team record.team[] · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Date record.dates[] · 2 props
PropTypeDescription
label*stringWordswhat the value is about
value*stringWordsthe value, as the merchant states it
Counter record.counters[] · 2 props
PropTypeDescription
label*stringWordswhat the figure is
value*numberthe count
Options options · 1 props
PropTypeDescription
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
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: open
  • Reads records from your app

A dashboard section, for app pages.

More dashboard blocks

  • 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.
  • Report breakdown: The merchant’s own breakdown table leads beside a written reading, with charts as supporting evidence below.
  • Report comparison: The merchant’s own current and previous figures are compared in a ledger above two aligned charts.
  • Report summary: A document-like overview of the merchant’s own period figures, followed by charts and the detailed breakdown.
  • Resource quota rings: a plan overview: each resource a small card whose ring shows the share used, for a few quotas read at a glance.

All 20 dashboard blocks