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

checkbox-rtl.tsx — ui Source File

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

File tsx DocumentationAtlas Changelog 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  e3f6925b_1552_4e2c_714a_2d6251b86936["checkbox-rtl.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  e3f6925b_1552_4e2c_714a_2d6251b86936 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  3a78bac7_f7e1_bd62_bf90_067c8b71835a["checkbox"]
  e3f6925b_1552_4e2c_714a_2d6251b86936 --> 3a78bac7_f7e1_bd62_bf90_067c8b71835a
  68874b2d_841d_f625_bf4f_104dc94b730e["field"]
  e3f6925b_1552_4e2c_714a_2d6251b86936 --> 68874b2d_841d_f625_bf4f_104dc94b730e
  1694dbfa_4abe_3ae7_75bf_e2205e001104["label"]
  e3f6925b_1552_4e2c_714a_2d6251b86936 --> 1694dbfa_4abe_3ae7_75bf_e2205e001104
  2c1404ab_bf28_6225_f9a0_b9e29400c66c["language-selector"]
  e3f6925b_1552_4e2c_714a_2d6251b86936 --> 2c1404ab_bf28_6225_f9a0_b9e29400c66c
  style e3f6925b_1552_4e2c_714a_2d6251b86936 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { Checkbox } from "@/examples/radix/ui-rtl/checkbox"
import {
  Field,
  FieldContent,
  FieldDescription,
  FieldGroup,
  FieldLabel,
  FieldTitle,
} from "@/examples/radix/ui-rtl/field"
import { Label } from "@/examples/radix/ui-rtl/label"

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

const translations: Translations = {
  en: {
    dir: "ltr",
    values: {
      acceptTerms: "Accept terms and conditions",
      acceptTermsDescription:
        "By clicking this checkbox, you agree to the terms.",
      enableNotifications: "Enable notifications",
      enableNotificationsDescription:
        "You can enable or disable notifications at any time.",
    },
  },
  ar: {
    dir: "rtl",
    values: {
      acceptTerms: "قبول الشروط والأحكام",
      acceptTermsDescription: "بالنقر على هذا المربع، فإنك توافق على الشروط.",
      enableNotifications: "تفعيل الإشعارات",
      enableNotificationsDescription:
        "يمكنك تفعيل أو إلغاء تفعيل الإشعارات في أي وقت.",
    },
  },
  he: {
    dir: "rtl",
    values: {
      acceptTerms: "קבל תנאים והגבלות",
      acceptTermsDescription:
        "על ידי לחיצה על תיבת הסימון הזו, אתה מסכים לתנאים.",
      enableNotifications: "הפעל התראות",
      enableNotificationsDescription:
        "אתה יכול להפעיל או להשבית התראות בכל עת.",
    },
  },
}

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

  return (
    <FieldGroup className="max-w-sm" dir={dir}>
      <Field orientation="horizontal">
        <Checkbox id="terms-checkbox-rtl" name="terms-checkbox" />
        <Label htmlFor="terms-checkbox-rtl">{t.acceptTerms}</Label>
      </Field>
      <Field orientation="horizontal">
        <Checkbox
          id="terms-checkbox-2-rtl"
          name="terms-checkbox-2"
          defaultChecked
        />
        <FieldContent>
          <FieldLabel htmlFor="terms-checkbox-2-rtl">
            {t.acceptTerms}
          </FieldLabel>
          <FieldDescription>{t.acceptTermsDescription}</FieldDescription>
        </FieldContent>
      </Field>
      <Field orientation="horizontal" data-disabled>
        <Checkbox id="toggle-checkbox-rtl" name="toggle-checkbox" disabled />
        <FieldLabel htmlFor="toggle-checkbox-rtl">
          {t.enableNotifications}
        </FieldLabel>
      </Field>
      <FieldLabel>
        <Field orientation="horizontal">
          <Checkbox id="toggle-checkbox-2" name="toggle-checkbox-2" />
          <FieldContent>
            <FieldTitle>{t.enableNotifications}</FieldTitle>
            <FieldDescription>
              {t.enableNotificationsDescription}
            </FieldDescription>
          </FieldContent>
        </Field>
      </FieldLabel>
    </FieldGroup>
  )
}

Subdomains

Functions

Dependencies

  • checkbox
  • field
  • label
  • language-selector
  • react

Frequently Asked Questions

What does checkbox-rtl.tsx do?
checkbox-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 checkbox-rtl.tsx?
checkbox-rtl.tsx defines 1 function(s): CheckboxRtl.
What does checkbox-rtl.tsx depend on?
checkbox-rtl.tsx imports 5 module(s): checkbox, field, label, language-selector, react.
Where is checkbox-rtl.tsx in the architecture?
checkbox-rtl.tsx is located at apps/v4/examples/radix/checkbox-rtl.tsx (domain: DocumentationAtlas, subdomain: Changelog, 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