Render a generative UI spec into React. The renderer resolves spec nodes against your component registry, and the error thrown when a component cannot be resolved.
API Reference
GenerativeUIRender
Internal renderer. Resolves a GenerativeUISpec against the consumer
allowlist. Used by MessagePrimitive.GenerativeUI and by
MessagePrimitive.Parts when handling a generative-ui part.
GenerativeUIRender propsspec: GenerativeUISpecThe JSON spec to render.
root: GenerativeUINode | readonly GenerativeUINode[]Root node(s) to render.
components: GenerativeUIComponentRegistryThe component allowlist.
Fallback?: ComponentType<{ component: string; props?: unknown }>Optional fallback for unknown component names.
GenerativeUIRenderError
Thrown when a generative-ui spec references a component name that is not
present in the consumer-provided allowlist. The allowlist is the security
boundary in the same-realm rendering path — there is no fallback by
default. Pass Fallback to opt into a soft-fail UX.
GenerativeUIRenderErrorconstructor?: (componentName: string, message: string = `Component "${componentName}" is not in the generative-ui allowlist.`) => GenerativeUIRenderErrorcomponentName?: string