update_element
Update a UI element by providing its UUID and a data object containing HTML attributes, classes, text, and event handlers. Supports Blade view naming and loop variable references.
Instructions
Update a UI element. Data object: tag, classes, text, event handlers (method UUIDs), classBindings. Set 'name' on root elements to create Blade views (e.g., name="notes.index" for view('notes.index')).
For elements inside @foreach loops (SSR/Blade):
Use these attributes to reference the loop variable (defaults to $item):
textField: Field name for text content → outputs{{ $item->fieldName }}hrefField: Field name for href → outputshref="{{ $item->fieldName }}"(field value ONLY, no prefix)srcField: Field name for src → outputssrc="{{ $item->fieldName }}"
For hrefs with path prefixes (IMPORTANT):
hrefField outputs ONLY the field value. There is NO hrefPrefix attribute.
For links like /post/slug-here, you MUST use hrefExpression:
hrefExpression: "/post/{{ $item->slug }}"→ outputshref="/post/{{ $item->slug }}"hrefExpression: "/category/{{ $item->slug }}"→ outputshref="/category/{{ $item->slug }}"
For complex Blade expressions in attributes: Use expression attributes when you need more than simple field access:
hrefExpression: Blade expression for href → outputshref="..."with the expressionsrcExpression: Blade expression for src → outputssrc="..."with the expressionaltExpression: Blade expression for alt → outputsalt="..."with the expression
Examples:
Path prefix:
hrefExpression: "/post/{{ $item->slug }}"Route helper:
hrefExpression: "{{ route('posts.show', $item->slug) }}"
For Blade text content:
Use the statements array with statement UUIDs containing Blade code. The statement's code property will be output directly for Blade to evaluate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | UUID of the element to update | |
| data | Yes | HTML attributes and Stellify fields (tag, classes, text, classBindings, click, submit). Context fields: summary, rationale, references, decisions. |