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/openui/core/interfaces/UseOpenUIStateOptions.md.
Lynx
  • English
  • Interface: UseOpenUIStateOptions

    Inputs used to parse OpenUI text and build renderer state.

    Properties

    initialQueryResults?

    optional initialQueryResults?: Readonly<Record<string, unknown>>

    Prefetched Query results keyed by the Query assignment name (statement ID). They are available during the initial render and act as fallbacks while an optional tool provider revalidates them after commit.


    initialState?

    optional initialState?: Record<string, unknown>


    isStreaming

    isStreaming: boolean


    library

    library: Library


    onAction?

    optional onAction?: (event: ActionEvent) => void

    Parameters

    ParameterType
    eventActionEvent

    Returns

    void


    onError?

    optional onError?: (errors: OpenUIError[]) => void

    Callback for structured, LLM-friendly errors. See OpenUIError type.

    Parameters

    ParameterType
    errorsOpenUIError[]

    Returns

    void


    onStateUpdate?

    optional onStateUpdate?: (state: Record<string, unknown>) => void

    Parameters

    ParameterType
    stateRecord<string, unknown>

    Returns

    void


    response

    response: string | null


    toolProvider?

    optional toolProvider?: ToolProvider | null

    ToolProvider for Query data fetching — MCP, REST, GraphQL, or any backend.

    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.