Ga naar hoofdinhoud

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

NameTypeRequiredDefaultDescription
titlestring''Block title
countnumber0The main count number to display prominently
countLabelstring() =&gt; t('nextcloud-vue', 'objects')Label displayed next to the count
breakdownobjectnullDetailed breakdown object (key-value pairs)
loadingbooleanfalseWhether data is currently loading
loadingLabelstring() =&gt; t('nextcloud-vue', 'Loading...')Text shown while loading
emptyLabelstring() =&gt; t('nextcloud-vue', 'No items found')Text shown when count is 0
iconobject&#124;funcnullIcon component (e.g., imported MDI icon)
iconSizenumber24Icon size in pixels
variantstring'default'Color variant: 'default', 'primary', 'success', 'warning', 'error'
horizontalbooleanfalseUse horizontal layout (icon left, content right)
clickablebooleanfalseWhether the card is clickable
showZeroCountbooleanfalseWhether to display 0 as a count value instead of the empty label
routeobjectnullVue 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