Skip to content

Auto

Choose an inspectable built-in renderer for a Python value.

Import from hedron import Auto
Distribution hedron
Backend activity No
Normal render mode RenderMode.FRAGMENT

Live demo

Region
iad
Healthy
True
Replicas
3

The preview is a local docs simulation (not a running Hedron server). Interactive demos show a “Simulated HTMX” trace when applicable.

Basic use

from hedron import Auto

component = Auto({'region': 'iad', 'healthy': True})

Compose under Page for full documents, or return from a fragment route for HTMX swaps.

How it works

Auto applies bounded data intelligence and records why a renderer was selected. Mappings become description lists, sequences can become lists or tables, and explicit as_ overrides ambiguity.

This component's core behavior is server-rendered HTML and does not require a browser runtime. The preview is ordinary semantic HTML, so keyboard, form, link, and disclosure behavior comes from the platform.

Constructor and parameters

Auto(value=None, *, as_=None)
Parameter Type Meaning
value Any Value to inspect and render.
as_ str | None Explicit renderer override.

Composition and backend behavior

Keep Auto at the smallest semantic boundary. Fragment routes should return only the replaced region and preserve stable target IDs across success, validation, empty, loading, and error responses.

This component is primarily presentational; keep any mutation on an explicit action or component route.

Accessibility

Inspect generated hierarchy and table labeling; automatic structure cannot infer every domain meaning.

Security

Escaping and SafeUrl / TrustedHtml are framework concerns; authorization and data exposure remain application code. Redact secrets before rendering.

Common mistakes

  • Do not pass unbounded, secret-bearing, or adversarial objects without limits and redaction.
  • Do not copy docs-preview JavaScript into an application server.

Testing

from hedron import RenderMode, render

result = render(component, mode=RenderMode.FRAGMENT)
assert result.html
assert not result.diagnostics

All component demos · Built-in API · Testing