View field
Custom HTML inside the form — not dehydrated, fully yours.
Standalone
Section titled “Standalone”from almasix.orbit.forms import Form, ViewField
form = Form.make("demo").schema([ ViewField.make("preview") .content("<strong class=\"or-badge\">Live preview</strong>")])In a Resource
Section titled “In a Resource”from almasix.orbit import Resourcefrom almasix.orbit.forms import Form, ViewField
class PostResource(Resource): @classmethod def form(cls, form: Form) -> Form: return form.schema([ ViewField.make("summary") .content(lambda state=None, record=None, **_: f"<p>{record.get('title')}</p>") .label("Summary"), ])Key methods
Section titled “Key methods”.content(str | callable) — HTML string (callable getsstate+ ctx)Not dehydrated by default.label(...) / .visible(...)Falls back to escaped state when content is unset
Closures work on .label(), .helper_text(), .placeholder(), .visible(), .disabled(), and .required() — see Form closures.
Preview
Section titled “Preview”
