Skip to content

API Reference parrot_formdesigner.renderers.html5

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.renderers.html5

View source

HTML5 form renderer for FormSchema.

Renders FormSchema + StyleSchema as HTML5

fragments using Jinja2 templates. Output is a form fragment (not a full page) ready to be embedded in a web application.

Alias AbstractFormRenderer

Re-exported from parrot_formdesigner.renderers.base.AbstractFormRenderer.

Alias AudioFieldRenderer

Re-exported from parrot_formdesigner.renderers.fields.audio.AudioFieldRenderer.

Alias DependencyRule

Re-exported from parrot_formdesigner.core.constraints.DependencyRule.

Alias FallbackRenderer

Re-exported from parrot_formdesigner.renderers.base.FallbackRenderer.

Alias FieldOption

Re-exported from parrot_formdesigner.core.options.FieldOption.

Alias FieldRenderer

Re-exported from parrot_formdesigner.renderers.base.FieldRenderer.

Alias FieldType

Re-exported from parrot_formdesigner.core.types.FieldType.

Alias FormEventsConfig

Re-exported from parrot_formdesigner.core.events.FormEventsConfig.

Alias FormField

Re-exported from parrot_formdesigner.core.schema.FormField.

Alias FormSchema

Re-exported from parrot_formdesigner.core.schema.FormSchema.

Alias FormSubsection

Re-exported from parrot_formdesigner.core.schema.FormSubsection.

Class HTML5Renderer

Renders FormSchema as an HTML5

fragment.

Uses Jinja2 templates (with autoescape=True) to produce HTML that can be served via API and embedded in any web page.

Output:

  • A fragment (no , , )
  • HTML5 validation attributes (required, minlength, maxlength, min, max, pattern, step)
  • data-depends-on attributes for conditional visibility rules
  • CSS classes for layout (form-layout--single_column, form-layout--two_column, etc.)
  • content_type="text/html"
Parameter Type Default Description
template_dir str | Path | None None Optional path to Jinja2 templates directory. Defaults to the bundled templates/ directory via PackageLoader.

Method HTML5Renderer.render

Render a FormSchema as an HTML5 form fragment.

render(form: FormSchema, style: StyleSchema | None = None, *, locale: str = 'en', prefilled: dict[str, Any] | None = None, errors: dict[str, str] | None = None, csrf_token: str | None = None) -> RenderedForm

Parameter Type Default Description
form FormSchema The form schema.
style StyleSchema | None None Style configuration.
locale str 'en' Locale for i18n label resolution.
prefilled dict[str, Any] | None None Pre-filled field values (field_id -> value).
errors dict[str, str] | None None Field-level error messages (field_id -> message).
csrf_token str | None None Optional per-session CSRF token for the remote event bridge. When provided and the form has lifecycle events, a <meta name="parrot-csrf-token"> tag is prepended to the output and the inline lifecycle script reads it.

Returns: RenderedForm — RenderedForm with HTML string as content and content_type="text/html".

Alias LocalizedString

Re-exported from parrot_formdesigner.core.types.LocalizedString.

Alias RenderWarning

Re-exported from parrot_formdesigner.core.schema.RenderWarning.

Alias RenderedForm

Re-exported from parrot_formdesigner.core.schema.RenderedForm.

Alias SnippetBundle

Re-exported from parrot_formdesigner.core.snippets.SnippetBundle.

Alias StyleSchema

Re-exported from parrot_formdesigner.core.style.StyleSchema.

Attribute logger

Alias render_worker_boot_block

Re-exported from parrot_formdesigner.renderers.worker_bridge.render_worker_boot_block.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally