New to KendoReactLearn about KendoReact Free.

GridAIPromptProps

Props for the GridAIPrompt component, which provides AI-powered prompt and output functionality in a grid toolbar.

tsx
<GridAIPrompt
  promptValue="Summarize this data"
  outputs={[{ text: "Summary...", ... }]}
  streaming={true}
  onPromptRequest={handlePrompt}
  suggestionsList={["Summarize", "Explain", "Generate chart"]}
/>
NameTypeDefaultDescription

activeView?

string

Name of the currently active view.

ts
activeView="prompt"

generateButton?

CustomComponent<ButtonProps>

Custom component to render the generate button.

ts
generateButton={CustomGenerateButton}

onActiveViewChange?

(viewName: string) => void

Callback fired when the active view changes.

ts
onActiveViewChange={(view) => setActiveView(view)}

onCancel?

() => void

Callback fired when the user cancels the current operation.

ts
onCancel={() => cancelPrompt()}

onClose?

() => void

Callback fired when the user closes the current operation.

ts
onClose={() => closePrompt()}

onCopy?

() => void

Callback fired when the user clicks the Copy button in the output card.

ts
onCopy={() => copyToClipboard()}

onOutputRating?

() => void

Callback fired when the user rates the output.

ts
onOutputRating={() => handleRating()}

onPromptRequest?

(prompt: string) => void

Callback fired when the user submits a prompt request.

ts
onPromptRequest={(prompt) => sendPrompt(prompt)}

outputCard?

AIPromptCardInterface

Configuration for the output card displaying AI results.

ts
outputCard={{ title: "AI Result", content: "..." }}

outputs?

AIPromptOutputInterface[]

List of AI-generated outputs to display.

ts
outputs={[{ text: "AI output 1" }, { text: "AI output 2" }]}

promptInput?

CustomComponent<TextAreaProps>

Custom component to render the prompt input field.

ts
promptInput={CustomTextArea}

promptPlaceHolder?

string

Placeholder text for the prompt input field.

ts
promptPlaceHolder="Type your question here..."

promptValue?

string

Current value of the prompt input field.

ts
promptValue="Describe the selected rows"

streaming?

boolean

Indicates whether the prompt is currently streaming or processing.

ts
streaming={true}

suggestionsList?

string[]

List of prompt suggestions to display to the user.

ts
suggestionsList={["Summarize", "Explain", "Generate chart"]}

toolbarItems?

AIPromptToolbarItemInterface[]

Array of toolbar items to display, can include prompt or output view defaults.

ts
toolbarItems={[promptViewDefaults, outputViewDefaults]}
Not finding the help you need?
Contact Support