Home / Function/ fetchTree() — ui Function Reference

fetchTree() — ui Function Reference

Architecture documentation for the fetchTree() function in api.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  26979903_bfa4_2ebc_e8bc_0f9a68c052af["fetchTree()"]
  c41eed12_c415_48c8_bcf4_9d09d3424a18["api.ts"]
  26979903_bfa4_2ebc_e8bc_0f9a68c052af -->|defined in| c41eed12_c415_48c8_bcf4_9d09d3424a18
  style 26979903_bfa4_2ebc_e8bc_0f9a68c052af fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/shadcn/src/registry/api.ts lines 242–254

export async function fetchTree(
  style: string,
  tree: z.infer<typeof registryIndexSchema>
) {
  try {
    const paths = tree.map((item) => `styles/${style}/${item.name}.json`)
    const results = await fetchRegistry(paths)
    return results.map((result) => registryItemSchema.parse(result))
  } catch (error) {
    handleError(error)
    return []
  }
}

Subdomains

Frequently Asked Questions

What does fetchTree() do?
fetchTree() is a function in the ui codebase, defined in packages/shadcn/src/registry/api.ts.
Where is fetchTree() defined?
fetchTree() is defined in packages/shadcn/src/registry/api.ts at line 242.

Analyze Your Own Codebase

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

Try Supermodel Free