For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/genui/a2ui/interfaces/A2UIProps.md.
Lynx
  • English
  • Interface: A2UIProps

    Props for the all-in-one A2UI ReactLynx renderer.

    Properties

    catalogId?

    optional catalogId?: string

    Exact protocol catalog id; defaults to the built-in Lynx catalog id.


    catalogs

    catalogs: readonly CatalogInput[]

    Components the renderer is allowed to instantiate. Each item is either a bare component (name read from displayName ?? name) or a tuple [component, manifest] where the manifest is the JSON the extractor emits at dist/catalog/<Name>/catalog.json.


    className?

    optional className?: string

    Optional class name applied to the top-level surface-${surfaceId} view for the active surface. Use this when theme switching is expressed as surface-level classes.


    messageStore

    messageStore: MessageStore | null

    The raw-message buffer the developer pushes protocol messages into. <A2UI> subscribes via useSyncExternalStore and processes new messages incrementally.

    Pass null to render nothing and end the current rendering session, without calling renderEmpty. Passing a store afterward starts a new session and processes all messages already in that store.

    The internal MessageProcessor (surfaces, signals, resources) is retained while messageStore stays non-null and is not reset if replaced directly with a different instance. Pass a key prop derived from the store's identity if you want a fresh session, e.g. <A2UI key={turnId} messageStore={turnStore} ... />.

    Example

    <A2UI messageStore={store ?? null} catalogs={catalogs} />

    onAction?

    optional onAction?: (action: UserActionPayload) => void

    Called when a user action fires inside the rendered tree (button tap, etc.). Forward to your agent and push the response messages back into the same messageStore to update the UI. Fire-and-forget; the renderer never awaits this.

    Parameters

    ParameterType
    actionUserActionPayload

    Returns

    void


    onMessage?

    optional onMessage?: (message: RendererToAgentMessage, metadata: Record<string, unknown>) => void | Promise<void>

    Forward v1.0 wire events and metadata; push responses into messageStore.

    Parameters

    ParameterType
    messageRendererToAgentMessage
    metadataRecord<string, unknown>

    Returns

    void | Promise<void>


    renderEmpty?

    optional renderEmpty?: () => ReactNode

    Render when a non-null messageStore has no surface ready yet.

    Returns

    ReactNode


    renderError?

    optional renderError?: (err: unknown) => ReactNode

    Render when the active resource fails.

    Parameters

    ParameterType
    errunknown

    Returns

    ReactNode


    renderFallback?

    optional renderFallback?: () => ReactNode

    Render while the active resource is pending.

    Returns

    ReactNode


    renderUnsupported?

    optional renderUnsupported?: (info: UnsupportedInfo) => ReactNode

    Render when unsupported data syntax or an unsupported component is encountered.

    Parameters

    ParameterType
    infoUnsupportedInfo

    Returns

    ReactNode


    wrapSurface?

    optional wrapSurface?: (children: ReactNode, ctx: object) => ReactNode

    Wrap each top-level surface so consumers can apply an outer theme shell, wrapper className, or additional styles.

    Parameters

    ParameterType
    childrenReactNode
    ctx{ surfaceId: string; }
    ctx.surfaceIdstring

    Returns

    ReactNode

    Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.