Skip to main content

getDefaultContent

Return a fresh copy of the defaultContent blob for a registered widget type from the shared dashboardWidgetRegistry.

import { getDefaultContent } from '@conduction/nextcloud-vue'

const content = getDefaultContent(type)
ArgumentTypeDescription
typestringThe widget type key.

Return value

TypeDescription
objectA fresh shallow copy of the type's defaultContent, or {} for unknown types so the caller never has to null-check.

A shallow copy is returned so a caller mutating the result does not pollute the registry defaults or another caller's content. useWidgetForm uses this to seed and merge form state. See dashboardWidgetRegistry for the full registry API.