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

toggle-rtl.tsx — ui Source File

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

File tsx DocumentationAtlas Changelog 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  9a97d5fe_7bf2_15a8_687a_23a64a752140["toggle-rtl.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  9a97d5fe_7bf2_15a8_687a_23a64a752140 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  72fb6f69_88f8_2278_f711_686056281cba["toggle"]
  9a97d5fe_7bf2_15a8_687a_23a64a752140 --> 72fb6f69_88f8_2278_f711_686056281cba
  d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"]
  9a97d5fe_7bf2_15a8_687a_23a64a752140 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  9a97d5fe_7bf2_15a8_687a_23a64a752140 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style 9a97d5fe_7bf2_15a8_687a_23a64a752140 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Toggle } from "@/examples/base/ui-rtl/toggle"
import { BookmarkIcon } from "lucide-react"

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

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      label: "Bookmark",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      label: "إشارة مرجعية",
    },
  },
  he: {
    dir: "rtl",
    values: {
      label: "סימנייה",
    },
  },
}

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

  return (
    <Toggle aria-label="Toggle bookmark" size="sm" variant="outline" dir={dir}>
      <BookmarkIcon className="group-aria-pressed/toggle:fill-foreground" />
      {t.label}
    </Toggle>
  )
}

Subdomains

Functions

Dependencies

  • language-selector
  • lucide-react
  • react
  • toggle

Frequently Asked Questions

What does toggle-rtl.tsx do?
toggle-rtl.tsx is a source file in the ui codebase, written in tsx. It belongs to the DocumentationAtlas domain, Changelog subdomain.
What functions are defined in toggle-rtl.tsx?
toggle-rtl.tsx defines 1 function(s): ToggleRtl.
What does toggle-rtl.tsx depend on?
toggle-rtl.tsx imports 4 module(s): language-selector, lucide-react, react, toggle.
Where is toggle-rtl.tsx in the architecture?
toggle-rtl.tsx is located at apps/v4/examples/base/toggle-rtl.tsx (domain: DocumentationAtlas, subdomain: Changelog, directory: apps/v4/examples/base).

Analyze Your Own Codebase

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

Try Supermodel Free