Home / File/ component-preview.tsx — ui Source File

component-preview.tsx — ui Source File

Architecture documentation for component-preview.tsx, a tsx file in the ui codebase. 5 imports, 0 dependents.

File tsx Internationalization Dictionary 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  9a89a3db_1a52_0859_7037_9840e35b85b1["component-preview.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  9a89a3db_1a52_0859_7037_9840e35b85b1 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  3eb36dd7_f51a_1431_02e2_7abafe315718["image"]
  9a89a3db_1a52_0859_7037_9840e35b85b1 --> 3eb36dd7_f51a_1431_02e2_7abafe315718
  7a25f51b_551e_131b_bc51_bd5ccc7c308c["registry"]
  9a89a3db_1a52_0859_7037_9840e35b85b1 --> 7a25f51b_551e_131b_bc51_bd5ccc7c308c
  8c42bbef_ddff_3aa7_5d53_e86dfc77e109["component-preview-tabs"]
  9a89a3db_1a52_0859_7037_9840e35b85b1 --> 8c42bbef_ddff_3aa7_5d53_e86dfc77e109
  dda68338_1183_340a_3c3e_bb23b5396d0d["component-source"]
  9a89a3db_1a52_0859_7037_9840e35b85b1 --> dda68338_1183_340a_3c3e_bb23b5396d0d
  style 9a89a3db_1a52_0859_7037_9840e35b85b1 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import * as React from "react"
import Image from "next/image"

import { getRegistryComponent } from "@/lib/registry"
import { ComponentPreviewTabs } from "@/components/component-preview-tabs"
import { ComponentSource } from "@/components/component-source"

export function ComponentPreview({
  name,
  type,
  className,
  previewClassName,
  align = "center",
  hideCode = false,
  chromeLessOnMobile = false,
  styleName = "new-york-v4",
  direction = "ltr",
  caption,
  ...props
}: React.ComponentProps<"div"> & {
  name: string
  styleName?: string
  align?: "center" | "start" | "end"
  description?: string
  hideCode?: boolean
  type?: "block" | "component" | "example"
  chromeLessOnMobile?: boolean
  previewClassName?: string
  direction?: "ltr" | "rtl"
  caption?: string
}) {
  if (type === "block") {
    const content = (
      <div className="relative mt-6 aspect-[4/2.5] w-full overflow-hidden rounded-xl border md:-mx-1">
        <Image
          src={`/r/styles/new-york-v4/${name}-light.png`}
          alt={name}
          width={1440}
          height={900}
          className="bg-background absolute top-0 left-0 z-20 w-[970px] max-w-none sm:w-[1280px] md:hidden dark:hidden md:dark:hidden"
        />
        <Image
          src={`/r/styles/new-york-v4/${name}-dark.png`}
          alt={name}
          width={1440}
          height={900}
          className="bg-background absolute top-0 left-0 z-20 hidden w-[970px] max-w-none sm:w-[1280px] md:hidden dark:block md:dark:hidden"
        />
        <div className="bg-background absolute inset-0 hidden w-[1600px] md:block">
          <iframe src={`/view/${styleName}/${name}`} className="size-full" />
        </div>
      </div>
    )

    if (caption) {
      return (
        <figure className="flex flex-col gap-4">
          {content}
          <figcaption className="text-muted-foreground text-center text-sm">
            {caption}
// ... (68 more lines)

Subdomains

Functions

Dependencies

  • component-preview-tabs
  • component-source
  • image
  • react
  • registry

Frequently Asked Questions

What does component-preview.tsx do?
component-preview.tsx is a source file in the ui codebase, written in tsx. It belongs to the Internationalization domain, Dictionary subdomain.
What functions are defined in component-preview.tsx?
component-preview.tsx defines 1 function(s): ComponentPreview.
What does component-preview.tsx depend on?
component-preview.tsx imports 5 module(s): component-preview-tabs, component-source, image, react, registry.
Where is component-preview.tsx in the architecture?
component-preview.tsx is located at apps/v4/components/component-preview.tsx (domain: Internationalization, subdomain: Dictionary, directory: apps/v4/components).

Analyze Your Own Codebase

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

Try Supermodel Free