snapshot of https://github.com/shadcn-ui/ui.git (main, 2026-09-15; blobs > 131072B omitted)
This commit is contained in:
55
apps/v4/examples/radix/toggle-group-rtl.tsx
Normal file
55
apps/v4/examples/radix/toggle-group-rtl.tsx
Normal file
@@ -0,0 +1,55 @@
|
||||
"use client"
|
||||
|
||||
import {
|
||||
useTranslation,
|
||||
type Translations,
|
||||
} from "@/components/language-selector"
|
||||
import {
|
||||
ToggleGroup,
|
||||
ToggleGroupItem,
|
||||
} from "@/styles/radix-nova/ui-rtl/toggle-group"
|
||||
|
||||
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" type="single" defaultValue="list">
|
||||
<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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user