Home / Function/ V0Button() — ui Function Reference

V0Button() — ui Function Reference

Architecture documentation for the V0Button() function in v0-button.tsx from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  8176dc49_4390_c8cd_c016_a22ba9d4fc40["V0Button()"]
  abf83309_7c64_07e9_522b_7a2cbfb851f2["v0-button.tsx"]
  8176dc49_4390_c8cd_c016_a22ba9d4fc40 -->|defined in| abf83309_7c64_07e9_522b_7a2cbfb851f2
  style 8176dc49_4390_c8cd_c016_a22ba9d4fc40 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/app/(create)/components/v0-button.tsx lines 16–55

export function V0Button({ className }: { className?: string }) {
  const [params] = useDesignSystemSearchParams()
  const isMobile = useIsMobile()
  const isMounted = useMounted()

  const url = `${process.env.NEXT_PUBLIC_APP_URL}/create/v0?base=${params.base}&style=${params.style}&baseColor=${params.baseColor}&theme=${params.theme}&iconLibrary=${params.iconLibrary}&font=${params.font}&menuAccent=${params.menuAccent}&menuColor=${params.menuColor}&radius=${params.radius}&item=${params.item}`

  if (!isMounted) {
    return <Skeleton className="h-8 w-24 rounded-lg" />
  }

  return (
    <>
      <Tooltip>
        <TooltipTrigger asChild>
          <Button
            size="sm"
            variant={isMobile ? "default" : "outline"}
            className={cn(
              "w-24 rounded-lg shadow-none data-[variant=default]:h-[31px] lg:w-8 xl:w-24",
              className
            )}
            asChild
          >
            <a
              href={`${process.env.NEXT_PUBLIC_V0_URL}/chat/api/open?url=${encodeURIComponent(url)}&title=${params.item}`}
              target="_blank"
            >
              <span className="lg:hidden xl:block">Open in</span>
              <Icons.v0 className="size-5" />
            </a>
          </Button>
        </TooltipTrigger>
        <TooltipContent>
          <p>Open current design in v0</p>
        </TooltipContent>
      </Tooltip>
    </>
  )
}

Domain

Subdomains

Frequently Asked Questions

What does V0Button() do?
V0Button() is a function in the ui codebase, defined in apps/v4/app/(create)/components/v0-button.tsx.
Where is V0Button() defined?
V0Button() is defined in apps/v4/app/(create)/components/v0-button.tsx at line 16.

Analyze Your Own Codebase

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

Try Supermodel Free