Skip to content

BeechCMS


BeechCMS / @beechcms/widget-sdk / WidgetDefinition

Interface: WidgetDefinition<TConfig> ​

Describes a widget type that can be placed on the dashboard.

Type Parameters ​

TConfig ​

TConfig = unknown

Properties ​

category ​

category: "stats" | "charts" | "content" | "system" | "custom"


component ​

component: ComponentType<DashboardWidgetProps<TConfig>>


ConfigPanel? ​

optional ConfigPanel?: ComponentType<{ config: TConfig; onChange: (next) => void; }>

Builder hint: config panel. Absent = "no options" notice.


configSchema ​

configSchema: ZodType<TConfig>

Schema with .catch()/.optional() so partial configs always parse.


defaultConfig ​

defaultConfig: TConfig


descriptionKey? ​

optional descriptionKey?: string


icon? ​

optional icon?: string

Dashboard icon name for the picker (a reicon-react icon name, not a Lucide one); unknown names render a folder.


labelKey ​

labelKey: string

i18n key for the picker (built-ins); plain string allowed (custom).


minColumnSpan? ​

optional minColumnSpan?: number

Builder hint: minimum sensible column span out of 12.


requires? ​

optional requires?: WidgetRequirement

What a caller needs to use this widget, evaluated with @beechcms/core's isWidgetRequirementMet. Absent = every caller. The dashboard hides a widget whose requirement is unmet, and the builder palette does not offer it. Ignored for built-in core/ types, whose requirement core resolves.


type ​

type: string

Namespaced type: core/<name> for built-ins, npm name for custom.