Home / File/ popover.tsx — ui Source File

popover.tsx — ui Source File

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

File tsx ComponentRegistry ChartRegistry 3 imports 7 functions

Entity Profile

Dependency Diagram

graph LR
  4c35152c_8c0f_a438_6561_b97bc2ce7e28["popover.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  4c35152c_8c0f_a438_6561_b97bc2ce7e28 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  9c463da6_747b_38dc_586b_cbb4873070b1["radix-ui"]
  4c35152c_8c0f_a438_6561_b97bc2ce7e28 --> 9c463da6_747b_38dc_586b_cbb4873070b1
  ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6["utils"]
  4c35152c_8c0f_a438_6561_b97bc2ce7e28 --> ef4051f4_aeb7_8d0c_a726_0ba96ad80cf6
  style 4c35152c_8c0f_a438_6561_b97bc2ce7e28 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Popover as PopoverPrimitive } from "radix-ui"

import { cn } from "@/registry/bases/radix/lib/utils"

function Popover({
  ...props
}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
  return <PopoverPrimitive.Root data-slot="popover" {...props} />
}

function PopoverTrigger({
  ...props
}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
  return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
}

function PopoverContent({
  className,
  align = "center",
  sideOffset = 4,
  ...props
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
  return (
    <PopoverPrimitive.Portal>
      <PopoverPrimitive.Content
        data-slot="popover-content"
        align={align}
        sideOffset={sideOffset}
        className={cn(
          "cn-popover-content z-50 w-72 origin-(--radix-popover-content-transform-origin) outline-hidden",
          className
        )}
        {...props}
      />
    </PopoverPrimitive.Portal>
  )
}

function PopoverAnchor({
  ...props
}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
  return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
}

function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="popover-header"
      className={cn("cn-popover-header", className)}
      {...props}
    />
  )
}

function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
  return (
    <div
      data-slot="popover-title"
      className={cn("cn-popover-title", className)}
      {...props}
    />
  )
}

function PopoverDescription({
  className,
  ...props
}: React.ComponentProps<"p">) {
  return (
    <p
      data-slot="popover-description"
      className={cn("cn-popover-description", className)}
      {...props}
    />
  )
}

export {
  Popover,
  PopoverAnchor,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
}

Subdomains

Dependencies

  • radix-ui
  • react
  • utils

Frequently Asked Questions

What does popover.tsx do?
popover.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 popover.tsx?
popover.tsx defines 7 function(s): Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger.
What does popover.tsx depend on?
popover.tsx imports 3 module(s): radix-ui, react, utils.
Where is popover.tsx in the architecture?
popover.tsx is located at apps/v4/registry/bases/radix/ui/popover.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: apps/v4/registry/bases/radix/ui).

Analyze Your Own Codebase

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

Try Supermodel Free