CRUDUI

Home > @polyspec/crudui-generator-core > WidgetModel

WidgetModel interface

The fully-evaluated, markup-free description of one leaf widget. A field adapter renders the element tree from THIS — it computes nothing.

Signature:

export interface WidgetModel 

Properties

Property

Modifiers

Type

Description

append?

Affix

(Optional) Append affix (content).

attrs

Attrs

Main control attributes (lowercase HTML names). Empty for file/cover.

condition?

ConditionEditorModel

(Optional) The structured condition editor, or its named error (layout condition).

extra?

Record<string, Attrs>

(Optional) Secondary attrs (image readonly display input, file input, choice option input shared attrs and the declared option attributes option).

itemLabelClass?

string

(Optional) Per-option label class (choice/multichoice).

kind

string

Resolved field type (registry key).

layout

'widget' | 'bare' | 'host-script' | 'choices' | 'file' | 'display' | 'search' | 'range' | 'condition' | 'button'

Layout family for the adapter (how to wrap the control).

options?

OptionModel[]

(Optional) Static options (select/choice/multichoice/search).

prepend?

Affix

(Optional) Prepend affix (content + design.prepend node).

rawHtml?

string

(Optional) RAW html for a display widget (dummy/image-viewer) — passes unescaped.

script?

string

(Optional) Inline script chrome text (editors/tagify/search).

source?

SourceAttrs | null

(Optional) Dynamic source stub descriptor (data-source-* attrs), or null when static.

styleChrome?

string

(Optional) Inline style chrome text (search hide_searching).

tag?

'input' | 'select' | 'textarea' | 'div' | 'button'

(Optional) Main control element name ('input'|'select'|'textarea'|'div'|'button').

text?

string

(Optional) Textarea/dummy text content, range output text and button content (already display-resolved).