Home / File/ popover-rtl.tsx — ui Source File

popover-rtl.tsx — ui Source File

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

File tsx DocumentationAtlas ContentSourcing 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  a485cd5f_ff94_3e09_18de_72684a02e59e["popover-rtl.tsx"]
  c79cdc74_50fb_62bd_465f_35936d2c5eac["button"]
  a485cd5f_ff94_3e09_18de_72684a02e59e --> c79cdc74_50fb_62bd_465f_35936d2c5eac
  87fb7c41_26a3_e875_c5a2_2eab81f4d78b["popover"]
  a485cd5f_ff94_3e09_18de_72684a02e59e --> 87fb7c41_26a3_e875_c5a2_2eab81f4d78b
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  a485cd5f_ff94_3e09_18de_72684a02e59e --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style a485cd5f_ff94_3e09_18de_72684a02e59e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { Button } from "@/examples/radix/ui-rtl/button"
import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from "@/examples/radix/ui-rtl/popover"

import {
  useTranslation,
  type Translations,
} from "@/components/language-selector"

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      title: "Dimensions",
      description: "Set the dimensions for the layer.",
      left: "Left",
      top: "Top",
      bottom: "Bottom",
      right: "Right",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      title: "الأبعاد",
      description: "تعيين الأبعاد للطبقة.",
      left: "يسار",
      top: "أعلى",
      bottom: "أسفل",
      right: "يمين",
    },
  },
  he: {
    dir: "rtl",
    values: {
      title: "מימדים",
      description: "הגדר את המימדים לשכבה.",
      left: "שמאל",
      top: "למעלה",
      bottom: "למטה",
      right: "ימין",
    },
  },
}

const physicalSides = ["left", "top", "bottom", "right"] as const

export function PopoverRtl() {
  const { dir, t } = useTranslation(translations, "ar")

  return (
    <div className="flex flex-wrap justify-center gap-2">
      {physicalSides.map((side) => (
        <Popover key={side}>
          <PopoverTrigger asChild>
            <Button variant="outline">{t[side]}</Button>
          </PopoverTrigger>
          <PopoverContent side={side} dir={dir}>
            <PopoverHeader>
              <PopoverTitle>{t.title}</PopoverTitle>
              <PopoverDescription>{t.description}</PopoverDescription>
            </PopoverHeader>
          </PopoverContent>
        </Popover>
      ))}
    </div>
  )
}

Subdomains

Functions

Dependencies

  • button
  • language-selector
  • popover

Frequently Asked Questions

What does popover-rtl.tsx do?
popover-rtl.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, ContentSourcing subdomain.
What functions are defined in popover-rtl.tsx?
popover-rtl.tsx defines 1 function(s): PopoverRtl.
What does popover-rtl.tsx depend on?
popover-rtl.tsx imports 3 module(s): button, language-selector, popover.
Where is popover-rtl.tsx in the architecture?
popover-rtl.tsx is located at apps/v4/examples/radix/popover-rtl.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, directory: apps/v4/examples/radix).

Analyze Your Own Codebase

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

Try Supermodel Free