Home / Function/ getDemoItem() — ui Function Reference

getDemoItem() — ui Function Reference

Architecture documentation for the getDemoItem() function in registry.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  f8dff198_75dc_8999_dc90_3442aea61824["getDemoItem()"]
  a2cd9f1d_8dbe_d488_4209_1dbd8f522cc1["registry.ts"]
  f8dff198_75dc_8999_dc90_3442aea61824 -->|defined in| a2cd9f1d_8dbe_d488_4209_1dbd8f522cc1
  b64dce39_bc30_17e3_5963_dc80daa2a191["getBaseForStyle()"]
  f8dff198_75dc_8999_dc90_3442aea61824 -->|calls| b64dce39_bc30_17e3_5963_dc80daa2a191
  style f8dff198_75dc_8999_dc90_3442aea61824 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/lib/registry.ts lines 37–60

export async function getDemoItem(name: string, styleName: string) {
  const base = getBaseForStyle(styleName)
  if (!base) return null

  const demo = ExamplesIndex[base]?.[name]
  if (!demo) {
    return null
  }

  const filePath = path.join(process.cwd(), demo.filePath)
  const content = await fs.readFile(filePath, "utf-8")

  return {
    name: demo.name,
    type: "registry:internal" as const,
    files: [
      {
        path: demo.filePath,
        content,
        type: "registry:internal" as const,
      },
    ],
  }
}

Subdomains

Frequently Asked Questions

What does getDemoItem() do?
getDemoItem() is a function in the ui codebase, defined in apps/v4/lib/registry.ts.
Where is getDemoItem() defined?
getDemoItem() is defined in apps/v4/lib/registry.ts at line 37.
What does getDemoItem() call?
getDemoItem() calls 1 function(s): getBaseForStyle.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free