Skip to main content

CnStatsBlock

Statistics display card with icon, count, and optional breakdown. Used inside CnKpiGrid.

Wraps: NcLoadingIcon

Try it

Loading CnStatsBlock playground…

CnStatsBlock showing pipeline statistics

Props

PropTypeDefaultDescription
titleString''Card title
countNumber0Main count value (formatted with toLocaleString)
countLabelString'objects'Unit label below count
breakdownObjectnullKey-value pairs for breakdown display
loadingBooleanfalseLoading state
loadingLabelString'Loading...'
emptyLabelString'No items found'
iconComponentnullMDI icon component
iconSizeNumber24Icon pixel size
variantString'default''default', 'primary', 'success', 'warning', 'error'
horizontalBooleanfalseIcon-left layout
clickableBooleanfalseEnable click interaction
showZeroCountBooleanfalseDisplay 0 as a count value instead of the empty label
routeObjectnullVue Router location object ({ name, path, query, ... }). When set, the card renders as a <router-link> and clickable styles are applied automatically.

Events

EventPayloadDescription
clickeventBlock clicked (only if clickable)

Slots

SlotDescription
#iconCustom icon content

Usage

<CnStatsBlock
title="Active Contacts"
:count="150"
count-label="contacts"
variant="primary"
:breakdown="{ 'This week': 12, 'This month': 43 }"
:icon="AccountGroupOutline"
:clickable="true"
@click="navigateToContacts" />

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnStatsBlock.vue and update automatically whenever the component changes.

Props

| Name | Type | Required | Default | Description | | --------------- | --------- | -------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | | title | string | | '' | Block title | | count | number | | 0 | The main count number to display prominently | | countLabel | string | | () =&gt; t('nextcloud-vue', 'objects') | Label displayed next to the count | | breakdown | object | | null | Detailed breakdown object (key-value pairs) | | loading | boolean | | false | Whether data is currently loading | | loadingLabel | string | | () =&gt; t('nextcloud-vue', 'Loading...') | Text shown while loading | | emptyLabel | string | | () =&gt; t('nextcloud-vue', 'No items found') | Text shown when count is 0 | | icon | object | func | | null | Icon component (e.g., imported MDI icon) | | iconSize | number | | 24 | Icon size in pixels | | variant | string | | 'default' | Color variant: 'default', 'primary', 'success', 'warning', 'error' | | horizontal | boolean | | false | Use horizontal layout (icon left, content right) | | clickable | boolean | | false | Whether the card is clickable | | showZeroCount | boolean | | false | Whether to display 0 as a count value instead of the empty label | | route | object | | null | Vue Router location object for declarative navigation. When set, the card renders as a <router-link> and clickable styles are implied. { name: 'Cases', query: { status: 'open' } } { path: '/catalogi' } |

Events

NamePayloadDescription
click

Slots

NameBindingsDescription
icon