Home / File/ tooltip.tsx — ui Source File

tooltip.tsx — ui Source File

Architecture documentation for tooltip.tsx, a tsx file in the ui codebase. 3 imports, 0 dependents.

File tsx ComponentRegistry ChartRegistry 3 imports 4 functions

Entity Profile

Dependency Diagram

graph LR
  e31f7c00_4aea_9877_aecf_eecc1122b6d4["tooltip.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  e31f7c00_4aea_9877_aecf_eecc1122b6d4 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"]
  e31f7c00_4aea_9877_aecf_eecc1122b6d4 --> 9c463da6_747b_38dc_586b_cbb4873070b1
  79081a1f_55a3_945a_fb8c_d53d6d3eab81["utils"]
  e31f7c00_4aea_9877_aecf_eecc1122b6d4 --> 79081a1f_55a3_945a_fb8c_d53d6d3eab81
  style e31f7c00_4aea_9877_aecf_eecc1122b6d4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Tooltip as TooltipPrimitive } from "radix-ui"

import { cn } from "@/lib/utils"

function TooltipProvider({
  delayDuration = 0,
  ...props
}: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
  return (
    <TooltipPrimitive.Provider
      data-slot="tooltip-provider"
      delayDuration={delayDuration}
      {...props}
    />
  )
}

function Tooltip({
  ...props
}: React.ComponentProps<typeof TooltipPrimitive.Root>) {
  return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
}

function TooltipTrigger({
  ...props
}: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
  return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
}

function TooltipContent({
  className,
  sideOffset = 0,
  children,
  ...props
}: React.ComponentProps<typeof TooltipPrimitive.Content>) {
  return (
    <TooltipPrimitive.Portal>
      <TooltipPrimitive.Content
        data-slot="tooltip-content"
        sideOffset={sideOffset}
        className={cn(
          "bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",
          className
        )}
        {...props}
      >
        {children}
        <TooltipPrimitive.Arrow className="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" />
      </TooltipPrimitive.Content>
    </TooltipPrimitive.Portal>
  )
}

export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }

Subdomains

Dependencies

  • radix-ui
  • react
  • utils

Frequently Asked Questions

What does tooltip.tsx do?
tooltip.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in tooltip.tsx?
tooltip.tsx defines 4 function(s): Tooltip, TooltipContent, TooltipProvider, TooltipTrigger.
What does tooltip.tsx depend on?
tooltip.tsx imports 3 module(s): radix-ui, react, utils.
Where is tooltip.tsx in the architecture?
tooltip.tsx is located at apps/v4/registry/new-york-v4/ui/tooltip.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/new-york-v4/ui).

Analyze Your Own Codebase

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

Try Supermodel Free