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

    A2UIProps

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

    属性

    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.

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:57


    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.

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:70


    messageStore

    messageStore: MessageStore;

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

    The internal MessageProcessor (surfaces, signals, resources) is created once per mount and is not reset if messageStore is later replaced 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} ... />.

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:50


    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.

    参数

    范围类型
    actionUserActionPayload

    返回

    void

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:64


    renderEmpty()?

    optional renderEmpty: () => ReactNode;

    Render before the first beginRendering arrives from the buffer.

    返回

    ReactNode

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:80


    renderError()?

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

    Render when the active resource fails.

    参数

    范围类型
    errunknown

    返回

    ReactNode

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:84


    renderFallback()?

    optional renderFallback: () => ReactNode;

    Render while the active resource is pending.

    返回

    ReactNode

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:82


    renderUnsupported()?

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

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

    参数

    范围类型
    infoUnsupportedInfo

    返回

    ReactNode

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:86


    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.

    参数

    范围类型
    childrenReactNode
    ctxobject
    ctx.surfaceIdstring

    返回

    ReactNode

    定义于

    @lynx-js/genui/a2ui/src/react/A2UI.tsx:75

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。