This component allows you to dynamically render text fields and select inputs based on the provided data.

Currently only available with shadcn.
npx shadcn add "https://raw.githubusercontent.com/mindtown-ai/dynamic-prompt/main/schema.json"
Here's an example of how to use the DynamicPrompt component:
import React from "react";
import DynamicPrompt from "@/components/DynamicPrompt";
const data = {
text: "Hello, {name}! Please select your favorite fruit: {fruit}.",
options: {
name: ["Alice", "Bob", "Charlie"],
fruit: ["Apple", "Banana", "Cherry"],
},
};
const App = () => {
const handleChange = (text: string) => {
console.log("Updated text:", text);
};
return <DynamicPrompt data={data} onChange={handleChange} />;
};
export default App;
interface DynamicTextFieldProps {
onChange: (text: string) => void;
CustomSelect?: React.ComponentType<any>;
data: { text: string; options: { [key: string]: string[] } };
}
This project is licensed under the MIT License. See the LICENSE file for details.
$ claude mcp add dynamic-prompt \
-- python -m otcore.mcp_server <graph>