MCPcopy Index your code
hub / github.com/aykutkardas/dynamic-prompt

github.com/aykutkardas/dynamic-prompt @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
8 symbols 20 edges 5 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Dynamic Prompt Component

[Experimental - Work in Progress]

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

demo

Installation

Currently only available with shadcn.

npx shadcn add "https://raw.githubusercontent.com/mindtown-ai/dynamic-prompt/main/schema.json"

Usage

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;

Prop Types

interface DynamicTextFieldProps {
  onChange: (text: string) => void;
  CustomSelect?: React.ComponentType<any>;
  data: { text: string; options: { [key: string]: string[] } };
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

Extension points exported contracts — how you extend this code

TextPart (Interface)
(no doc)
src/dynamic-prompt.tsx
DynamicTextFieldProps (Interface)
(no doc)
src/dynamic-prompt.tsx

Core symbols most depended-on inside this repo

cn
called by 8
src/lib/utils.ts
handleChange
called by 2
src/dynamic-prompt.tsx
setRef
called by 2
src/dynamic-prompt.tsx
parseText
called by 1
src/dynamic-prompt.tsx
reconstructText
called by 1
src/dynamic-prompt.tsx
DynamicTextField
called by 0
src/dynamic-prompt.tsx

Shape

Function 6
Interface 2

Languages

TypeScript100%

Modules by API surface

src/dynamic-prompt.tsx7 symbols
src/lib/utils.ts1 symbols

For agents

$ claude mcp add dynamic-prompt \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page