Resource quota rings — Dashboard block
Prodashboard-resource-quota-rings · for app, billing, analytics pages
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
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-resource-quota-ringsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import DashboardResourceQuotaRings from '@/components/trame/blocks/dashboard/dashboard-resource-quota-rings.vue'
const props = {
title: "Your plan",
items: [
{
label: "Photo storage",
value: 290,
unit: "GB",
used: 210,
limit: 500,
tone: "success",
status: "Plenty left",
icon: "storage"
},
{
label: "Team seats",
value: 1,
unit: "seat",
used: 9,
limit: 10,
tone: "warning",
status: "Almost full",
icon: "users",
open: "team"
}
]
}
</script>
<template>
<DashboardResourceQuotaRings v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title | string | Wordswhat the figures describe ("This week at the workshop") |
| items* | Item[] | the items shown, in order |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 14 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the figure counts ("Paid orders") |
| value* | number | null | Datathe figure, counted by the server: cents for money, seconds for a duration, null when unknown |
| format | 'number' | 'money' | 'percent' | 'duration' | how the figure reads: a number, money (cents), a percent or a duration (seconds) |
| unit | string | Wordsthe unit written after the figure ("GB", "orders") |
| delta | number | Datathe 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 |
| deltaLabel | string | Wordswhat the change compares to ("vs last month") |
| series | number[] | Datathe last points of the figure, oldest first, 30 at most |
| used | number | Dataa metered resource: what is used |
| limit | number | Dataa metered resource: what the plan allows |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the state the host reads in the figure; it colours the meter and the status |
| status | string | Wordsa short state or count ("6/6 goals", "Almost full") |
| icon | string | Designstorage, users, api, mail, database, orders, revenue, stock, goal |
| open | string | Actionwhere the figure leads: the list behind it |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| columns | '2' | '3' | '4' | 'auto' | how many columns on wide screens; auto by default |
| currency | string | DesignISO 4217 for money figures, the app’s by default |
| remaining | string | Wordsthe word after the share left ("remaining") |
| usedOf | string | Wordsthe words between used and limit ("used on") |
| 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 |
| Link | your router’s link component |
| 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
- Asks your app through actions:
items[].open - Reads
figuresfrom your app
A dashboard section, for app, billing, analytics 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
- 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.
- 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.
- 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.
- Split: a daily tool with a lot to scan: figures and chart in the main column, what needs attention and the quick actions in a side rail.