Components
BaseLegend
A colour legend for a segment bar or a chart: a dot, a label and an optional value.
components/ui/BaseLegend.vue
View in the demo
Example
Documents
24 GB
Images
8 GB
Videos
40 GB
Variants
layout="inline" puts the items in one wrapping line, size="small" fits sidebars, and selectable turns the rows into filters: pass the active id and listen to select.
Documents 24 GB Images 8 GB Videos 40 GB
Documents24 GB
Images8 GB
Videos40 GB
Documents
24 GB
Images
8 GB
Videos
40 GB
It is the legend of the receivables card in invoices (selectable), of revenue by course, of storage in the file manager (small) and of the seats card (inline).
API
Props
Name | Type | Default | Description |
|---|---|---|---|
items | BaseLegendItem[] | [] | The items: id, label, color and an optional value already formatted. |
layout | "list" | "inline" | "list" | list (one per row) or inline (one wrapping line). |
size | "default" | "small" | "default" | default or small, for sidebars. |
selectable | boolean | false | Turns the rows into buttons that emit select. |
active | string | null | null | The id of the selected row when selectable. |
label | string | — | The aria-label of the legend. |
Events
Name | Payload | Description |
|---|---|---|
@select | [id: string] | A selectable row was clicked; receives its id. |