Components
BaseBreakdownCard
A total split into parts, with a segmented bar and a legend that can filter a table.
components/ui/BaseBreakdownCard.vue
View in the demo
Example
Revenue this month
$48,250.00from 312 orders
Online grew 12% against last month.Online store
$28,450.00
Physical store
$12,900.00
Marketplace
$6,900.00
Use it above a list to show how a total splits: receivables by age, revenue by channel, stock by state. The module computes the parts and passes them as segments; with selectable, each legend item emits select with its id so the page can filter its table, and active marks the selected one. The caption slot takes markup, such as a coloured "collected this month". Invoices use it through InvoiceReceivablesCard.
API
Props
Name | Type | Default | Description |
|---|---|---|---|
titlerequired | string | — | The small label over the figure, such as "Outstanding". |
valuerequired | string | number | — | The total, already formatted. |
segmentsrequired | BaseBreakdownSegment[] | — | The parts of the total { id, label, value, color, display? }: value sizes the bar and display (a formatted amount) is shown in the legend instead of the raw value. |
caption | string | — | A short line next to the total, such as "in 4 invoices". The caption slot replaces it with markup. |
note | string | — | A quiet sentence under the bar, such as the average time to get paid. |
label | string | — | The accessible name of the bar and the legend. Defaults to the title. |
selectable | boolean | false | Turns the legend items into buttons that emit select, to filter a table by part. |
active | string | null | null | The id of the selected part. |
Slots
Name | Slot props | Description |
|---|---|---|
#caption | — | Replaces the caption next to the total. |
Events
Name | Payload | Description |
|---|---|---|
@select | [id: string] | The id of the clicked part. |