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

switch-rtl.tsx — ui Source File

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

File tsx DocumentationAtlas ContentSourcing 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  dd4f378a_3a60_0094_d666_bf33693225fa["switch-rtl.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  dd4f378a_3a60_0094_d666_bf33693225fa --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  68874b2d_841d_f625_bf4f_104dc94b730e["field"]
  dd4f378a_3a60_0094_d666_bf33693225fa --> 68874b2d_841d_f625_bf4f_104dc94b730e
  da994ff2_1aa1_dc19_d7a2_b5a24ccf7553["switch"]
  dd4f378a_3a60_0094_d666_bf33693225fa --> da994ff2_1aa1_dc19_d7a2_b5a24ccf7553
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  dd4f378a_3a60_0094_d666_bf33693225fa --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style dd4f378a_3a60_0094_d666_bf33693225fa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import {
  Field,
  FieldContent,
  FieldDescription,
  FieldLabel,
} from "@/examples/radix/ui-rtl/field"
import { Switch } from "@/examples/radix/ui-rtl/switch"

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

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      label: "Share across devices",
      description:
        "Focus is shared across devices, and turns off when you leave the app.",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      label: "المشاركة عبر الأجهزة",
      description:
        "يتم مشاركة التركيز عبر الأجهزة، ويتم إيقاف تشغيله عند مغادرة التطبيق.",
    },
  },
  he: {
    dir: "rtl",
    values: {
      label: "שיתוף בין מכשירים",
      description: "המיקוד משותף בין מכשירים, וכבה כשאתה עוזב את האפליקציה.",
    },
  },
}

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

  return (
    <Field orientation="horizontal" className="max-w-sm" dir={dir}>
      <FieldContent>
        <FieldLabel htmlFor="switch-focus-mode-rtl" dir={dir}>
          {t.label}
        </FieldLabel>
        <FieldDescription dir={dir}>{t.description}</FieldDescription>
      </FieldContent>
      <Switch id="switch-focus-mode-rtl" dir={dir} />
    </Field>
  )
}

Subdomains

Functions

Dependencies

  • field
  • language-selector
  • react
  • switch

Frequently Asked Questions

What does switch-rtl.tsx do?
switch-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 switch-rtl.tsx?
switch-rtl.tsx defines 1 function(s): SwitchRtl.
What does switch-rtl.tsx depend on?
switch-rtl.tsx imports 4 module(s): field, language-selector, react, switch.
Where is switch-rtl.tsx in the architecture?
switch-rtl.tsx is located at apps/v4/examples/radix/switch-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