@maxhealth.tech/prefab / auto / QuickFormBuilder
Class: QuickFormBuilder
Defined in: auto/form.ts:161
Chainable form builder for rapid MCP tool UI generation.
Example
const ui = QuickForm('create_user')
.title('Create User')
.text('name', { required: true })
.email('email', { required: true })
.submit('Create')
.build()Constructors
Constructor
new QuickFormBuilder(toolName): QuickFormBuilder;Defined in: auto/form.ts:171
Parameters
| Parameter | Type |
|---|---|
toolName | string |
Returns
QuickFormBuilder
Methods
title()
title(t): this;Defined in: auto/form.ts:175
Parameters
| Parameter | Type |
|---|---|
t | string |
Returns
this
subtitle()
subtitle(s): this;Defined in: auto/form.ts:176
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
this
submit()
submit(label): this;Defined in: auto/form.ts:177
Parameters
| Parameter | Type |
|---|---|
label | string |
Returns
this
onSubmit()
onSubmit(action): this;Defined in: auto/form.ts:178
Parameters
| Parameter | Type |
|---|---|
action | | Action | Action[] |
Returns
this
successMessage()
successMessage(msg): this;Defined in: auto/form.ts:179
Parameters
| Parameter | Type |
|---|---|
msg | string |
Returns
this
errorMessage()
errorMessage(msg): this;Defined in: auto/form.ts:180
Parameters
| Parameter | Type |
|---|---|
msg | string |
Returns
this
field()
field(name, opts?): this;Defined in: auto/form.ts:183
Add a field with explicit type.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "name"> |
Returns
this
text()
text(name, opts?): this;Defined in: auto/form.ts:189
Shorthand for type: 'text'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
email()
email(name, opts?): this;Defined in: auto/form.ts:194
Shorthand for type: 'email'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
number()
number(name, opts?): this;Defined in: auto/form.ts:199
Shorthand for type: 'number'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
password()
password(name, opts?): this;Defined in: auto/form.ts:204
Shorthand for type: 'password'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
url()
url(name, opts?): this;Defined in: auto/form.ts:209
Shorthand for type: 'url'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
tel()
tel(name, opts?): this;Defined in: auto/form.ts:214
Shorthand for type: 'tel'.
Parameters
| Parameter | Type |
|---|---|
name | string |
opts? | Omit<AutoFormField, "type" | "name"> |
Returns
this
build()
build(): ContainerComponent;Defined in: auto/form.ts:219
Build the form component tree.
Returns
ContainerComponent