icon-placeholder.tsx — ui Source File
Architecture documentation for icon-placeholder.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 72896a45_b124_4612_efea_d67f3581f577["icon-placeholder.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 72896a45_b124_4612_efea_d67f3581f577 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] 72896a45_b124_4612_efea_d67f3581f577 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 a9fe3d3c_59c9_c6d6_013e_80fd635d3135["icons"] 72896a45_b124_4612_efea_d67f3581f577 --> a9fe3d3c_59c9_c6d6_013e_80fd635d3135 c27c6e95_5daf_4dd4_dc3a_add496837570["search-params"] 72896a45_b124_4612_efea_d67f3581f577 --> c27c6e95_5daf_4dd4_dc3a_add496837570 style 72896a45_b124_4612_efea_d67f3581f577 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import { lazy, Suspense } from "react"
import { SquareIcon } from "lucide-react"
import type { IconLibraryName } from "shadcn/icons"
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"
const IconLucide = lazy(() =>
import("@/registry/icons/icon-lucide").then((mod) => ({
default: mod.IconLucide,
}))
)
const IconTabler = lazy(() =>
import("@/registry/icons/icon-tabler").then((mod) => ({
default: mod.IconTabler,
}))
)
const IconHugeicons = lazy(() =>
import("@/registry/icons/icon-hugeicons").then((mod) => ({
default: mod.IconHugeicons,
}))
)
const IconPhosphor = lazy(() =>
import("@/registry/icons/icon-phosphor").then((mod) => ({
default: mod.IconPhosphor,
}))
)
const IconRemixicon = lazy(() =>
import("@/registry/icons/icon-remixicon").then((mod) => ({
default: mod.IconRemixicon,
}))
)
export function IconPlaceholder({
...props
}: {
[K in IconLibraryName]: string
} & React.ComponentProps<"svg">) {
const [{ iconLibrary }] = useDesignSystemSearchParams()
const iconName = props[iconLibrary]
if (!iconName) {
return null
}
return (
<Suspense fallback={<SquareIcon {...props} />}>
{iconLibrary === "lucide" && <IconLucide name={iconName} {...props} />}
{iconLibrary === "tabler" && <IconTabler name={iconName} {...props} />}
{iconLibrary === "hugeicons" && (
<IconHugeicons name={iconName} {...props} />
)}
{iconLibrary === "phosphor" && (
<IconPhosphor name={iconName} {...props} />
)}
{iconLibrary === "remixicon" && (
<IconRemixicon name={iconName} {...props} />
)}
</Suspense>
)
}
Domain
Subdomains
Dependencies
- icons
- lucide-react
- react
- search-params
Source
Frequently Asked Questions
What does icon-placeholder.tsx do?
icon-placeholder.tsx is a source file in the ui codebase, written in tsx. It belongs to the DesignEngine domain, PreviewSystem subdomain.
What functions are defined in icon-placeholder.tsx?
icon-placeholder.tsx defines 6 function(s): IconHugeicons, IconLucide, IconPhosphor, IconPlaceholder, IconRemixicon, IconTabler.
What does icon-placeholder.tsx depend on?
icon-placeholder.tsx imports 4 module(s): icons, lucide-react, react, search-params.
Where is icon-placeholder.tsx in the architecture?
icon-placeholder.tsx is located at apps/v4/app/(create)/components/icon-placeholder.tsx (domain: DesignEngine, subdomain: PreviewSystem, directory: apps/v4/app/(create)/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free