{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "response-demo", "registryDependencies": [ "https://ui.elevenlabs.io/r/response.json" ], "files": [ { "path": "examples/response-demo.tsx", "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\n\nimport { Response } from \"@/components/ui/response\"\n\nconst tokens = [\n \"### Welcome\",\n \"\\n\\n\",\n \"This\",\n \" is\",\n \" a\",\n \" **rich\",\n \" markdown\",\n \"**\",\n \" showcase\",\n \" with\",\n \" multiple\",\n \" features.\",\n \"\\n\\n\",\n \"---\",\n \"\\n\\n\",\n \"## Data Table\",\n \"\\n\\n\",\n \"| Name\",\n \" | Role\",\n \" | Status\",\n \" |\",\n \"\\n\",\n \"|------|------|--------|\",\n \"\\n\",\n \"| Alice\",\n \" | Engineer\",\n \" | Active\",\n \" |\",\n \"\\n\",\n \"| Bob\",\n \" | Designer\",\n \" | Active\",\n \" |\",\n \"\\n\",\n \"| Carol\",\n \" | PM\",\n \" | Active\",\n \" |\",\n \"\\n\\n\",\n \"## Inspiration\",\n \"\\n\\n\",\n \"> *Simplicity\",\n \" is\",\n \" the\",\n \" ultimate\",\n \" sophistication.*\",\n \"\\n\",\n \"> —\",\n \" Leonardo\",\n \" da\",\n \" Vinci\",\n \"\\n\\n\",\n \"## Inline\",\n \" and\",\n \" Block\",\n \" Code\",\n \"\\n\\n\",\n \"Use\",\n \" `let\",\n \" total\",\n \" =\",\n \" items.length`\",\n \" to\",\n \" count\",\n \" elements.\",\n \"\\n\\n\",\n \"```\",\n \"python\",\n \"\\n\",\n \"def\",\n \" greet(name):\",\n \"\\n\",\n \" return\",\n ' f\"Hello, {name}!\"',\n \"\\n\",\n 'print(greet(\"World\"))',\n \"\\n\",\n \"```\",\n \"\\n\\n\",\n \"## Math\",\n \"\\n\\n\",\n \"Inline\",\n \" math:\",\n \" $a^2\",\n \" +\",\n \" b^2\",\n \" =\",\n \" c^2$\",\n \".\",\n \"\\n\\n\",\n \"Displayed\",\n \" equation:\",\n \"\\n\\n\",\n \"$$\",\n \"\\n\",\n \"\\\\int_0^1\",\n \" x^2\",\n \" dx\",\n \" =\",\n \" \\\\frac{1}{3}\",\n \"\\n\",\n \"$$\",\n \"\\n\\n\",\n]\n\nconst Example = () => {\n const [content, setContent] = useState(\"\")\n\n useEffect(() => {\n let currentContent = \"\"\n let index = 0\n\n const interval = setInterval(() => {\n if (index < tokens.length) {\n currentContent += tokens[index]\n setContent(currentContent)\n index++\n } else {\n clearInterval(interval)\n }\n }, 100)\n\n return () => clearInterval(interval)\n }, [])\n\n return (\n