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

toggle-group-rtl.tsx — ui Source File

Architecture documentation for toggle-group-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
  79dfcd12_3d41_41e8_9984_50fd4ac8ac61["toggle-group-rtl.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  79dfcd12_3d41_41e8_9984_50fd4ac8ac61 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  34566472_4893_bc99_edd9_62e675546999["toggle-group"]
  79dfcd12_3d41_41e8_9984_50fd4ac8ac61 --> 34566472_4893_bc99_edd9_62e675546999
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  79dfcd12_3d41_41e8_9984_50fd4ac8ac61 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style 79dfcd12_3d41_41e8_9984_50fd4ac8ac61 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import {
  ToggleGroup,
  ToggleGroupItem,
} from "@/examples/base/ui-rtl/toggle-group"

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

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      list: "List",
      grid: "Grid",
      cards: "Cards",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      list: "قائمة",
      grid: "شبكة",
      cards: "بطاقات",
    },
  },
  he: {
    dir: "rtl",
    values: {
      list: "רשימה",
      grid: "רשת",
      cards: "כרטיסים",
    },
  },
}

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

  return (
    <ToggleGroup variant="outline" defaultValue={["list"]} dir={dir}>
      <ToggleGroupItem value="list" aria-label={t.list}>
        {t.list}
      </ToggleGroupItem>
      <ToggleGroupItem value="grid" aria-label={t.grid}>
        {t.grid}
      </ToggleGroupItem>
      <ToggleGroupItem value="cards" aria-label={t.cards}>
        {t.cards}
      </ToggleGroupItem>
    </ToggleGroup>
  )
}

Subdomains

Functions

Dependencies

  • language-selector
  • react
  • toggle-group

Frequently Asked Questions

What does toggle-group-rtl.tsx do?
toggle-group-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 toggle-group-rtl.tsx?
toggle-group-rtl.tsx defines 1 function(s): ToggleGroupRtl.
What does toggle-group-rtl.tsx depend on?
toggle-group-rtl.tsx imports 3 module(s): language-selector, react, toggle-group.
Where is toggle-group-rtl.tsx in the architecture?
toggle-group-rtl.tsx is located at apps/v4/examples/base/toggle-group-rtl.tsx (domain: DocumentationAtlas, subdomain: ContentSourcing, 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