Skip to main content

CnWidgetWrapper

Container shell around a dashboard widget. Provides a header with icon and title, a scrollable content area, and an optional footer with action links. Accepts a styleConfig object for runtime style overrides (background, border, padding). Used internally by CnDashboardPage for all non-tile widgets.

Try it

Loading CnWidgetWrapper playground…

Usage

<!-- Basic wrapper -->
<CnWidgetWrapper title="My Cases" icon-url="/apps/myapp/img/icon.svg">
<MyCasesChart :data="chartData" />
</CnWidgetWrapper>

<!-- Without header (borderless, flush — for self-contained card widgets) -->
<CnWidgetWrapper :show-title="false" :borderless="true">
<CnStatsBlock :stats="kpis" />
</CnWidgetWrapper>

<!-- With NC widget object (used by CnDashboardPage internally) -->
<CnWidgetWrapper
:title="widget.title"
:icon-url="widget.iconUrl"
:icon-class="widget.iconClass"
:buttons="widget.buttons">
<CnWidgetRenderer :widget="widget" />
</CnWidgetWrapper>

<!-- With custom footer and header actions -->
<CnWidgetWrapper title="Tasks">
<template #actions>
<NcButton type="tertiary" @click="refresh">Refresh</NcButton>
</template>
<TaskList :items="tasks" />
<template #footer>
<a href="/apps/tasks">View all</a>
</template>
</CnWidgetWrapper>

Props

PropTypeDefaultDescription
titleString'Widget'Widget title shown in the header
showTitleBooleantrueWhether to render the header bar
borderlessBooleanfalseRemove border and background — makes the wrapper transparent
flushBooleanfalseRemove content padding — lets content extend edge-to-edge
iconUrlStringnullImage URL for the header icon
iconClassStringnullCSS class for the header icon (e.g. Nextcloud icon class)
titleIconPositionString'right'Position of the title-icon slot in the header: 'left' places it before the title group; 'right' places it after the actions
titleIconColorStringnullCSS color value applied to the title-icon slot container (e.g. '#e74c3c')
buttonsArray[]Footer button links: [{ text, link }]
styleConfigObject{}Runtime style overrides: { backgroundColor?, borderStyle?, borderWidth?, borderColor?, borderRadius?, padding?: { top, right, bottom, left } }

Slots

SlotDescription
defaultWidget content rendered in the scrollable body area
actionsButtons or controls placed in the right side of the header
title-iconExtra icon element rendered in the header at the position controlled by titleIconPosition (left of title or right of actions)
footerCustom footer content (replaces the buttons prop rendering)

Reference (auto-generated)

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

Props

NameTypeRequiredDefaultDescription
titlestring() =&gt; t('nextcloud-vue', 'Widget')Widget title
showTitlebooleantrueWhether to show the header with title
borderlessbooleanfalseRemove border and background — makes the wrapper transparent. Useful for widgets that are self-contained cards (e.g. CnStatsBlock).
flushbooleanfalseRemove content padding — allows content to go edge-to-edge. Useful for list-style widgets where items should span the full width.
iconUrlstringnullIcon URL (image)
iconClassstringnullIcon CSS class (e.g., Nextcloud icon class)
titleIconPositionstring'right'Position of the title-icon slot in the header. 'left' places it before the title; 'right' places it after the actions.
titleIconColorstringnullCSS color value applied to the title-icon slot container
buttonsarray[]Footer action buttons: [{ text, link }]
styleConfig{ backgroundColor: string, borderStyle: string, borderWidth: number, borderColor: string, borderRadius: number, padding: { top: number, right: number, bottom: number, left: number } }\{\}Style configuration for the wrapper.

Slots

NameBindingsDescription
title-icon
actions
default
footer