docs: add Lit custom component registration guide for v0.9 and v0.8#1428
Open
shahabl wants to merge 3 commits into
Open
docs: add Lit custom component registration guide for v0.9 and v0.8#1428shahabl wants to merge 3 commits into
shahabl wants to merge 3 commits into
Conversation
Document how to register custom components with the Lit renderer in both protocol versions. The v0.9 path (Catalog + MessageProcessor + catalogId) is documented as the primary approach. The v0.8 path (componentRegistry + enableCustomElements) is documented as legacy. The enableCustomElements property on Surface was easy to discover as a footgun — custom components silently don't render if the flag is not set before the surface/processor properties.
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the 'authoring-components.md' guide to include instructions for registering components with the Lit Renderer, covering both the recommended v0.9 protocol and the legacy v0.8 protocol. The review feedback suggests several improvements to the documentation's code snippets, including removing an unused import and adding clarifying comments for variables that are referenced but not defined within the examples.
- Remove unused A2uiLitElement import from v0.9 snippet - Add clarifying comment that MyChartElement is the user's Lit component class - Add inline comments for surface and processor variables in v0.8 snippet
ditman
reviewed
May 15, 2026
| - **Lazy Loading**: Use `import()` to lazy-load the component code. | ||
| - **Input Bindings**: Use `inputBinding` to map properties from the schema to Angular inputs. | ||
|
|
||
| ### Registering with the Lit Renderer |
Collaborator
There was a problem hiding this comment.
Thanks for adding this!
I think the angular renderer needs a level-3 title as well so the structure ends up as:
## 3. Registering with the Renderers (Client)
... probably nothing here, or a short intro ...
### Angular renderer
... instructions for angular ...
### Lit v0.9
... instructions for lit 0.9...
### Lit v0.8 (legacy)
...What do you think @zeroasterisk?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds documentation for registering custom components with the
@a2ui/litrenderer, covering both protocol versions. This addresses a gap noted in
#506 — the original PR was
closed because its docs targeted a file that no longer exists in the
updated structure.
The new section is added to
docs/guides/authoring-components.mdunderstep 3 (Registering with the Renderer), as a Lit-specific counterpart to
the existing Angular example.
v0.9 (primary path): Define a
Catalogwith a Zod schema, pass itto
MessageProcessoralongside other supported catalogs, and let theagent select it via
createSurface.catalogId. No client-side flagsneeded.
v0.8 (legacy): Register components in
componentRegistry, then setenableCustomElements = trueon the<a2ui-surface>element beforeassigning
surfaceandprocessor. Without this flag the componentssilently don't render even if correctly registered — a footgun worth
calling out explicitly.
Pre-launch Checklist