DrawerRtl() — ui Function Reference
Architecture documentation for the DrawerRtl() function in drawer-rtl.tsx from the ui codebase.
Entity Profile
Dependency Diagram
graph TD baee45be_e83b_355f_9763_cbb264a697f7["DrawerRtl()"] 873877eb_79f3_5d65_8d27_2b85953888d5["drawer-rtl.tsx"] baee45be_e83b_355f_9763_cbb264a697f7 -->|defined in| 873877eb_79f3_5d65_8d27_2b85953888d5 style baee45be_e83b_355f_9763_cbb264a697f7 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
apps/v4/examples/radix/drawer-rtl.tsx lines 110–193
export function DrawerRtl() {
const { dir, locale, language, t } = useTranslation(translations, "ar")
const [goal, setGoal] = React.useState(350)
function onClick(adjustment: number) {
setGoal(Math.max(200, Math.min(400, goal + adjustment)))
}
return (
<Drawer>
<DrawerTrigger asChild>
<Button variant="outline">{t.trigger}</Button>
</DrawerTrigger>
<DrawerContent dir={dir} data-lang={dir === "rtl" ? language : undefined}>
<div className="mx-auto w-full max-w-sm">
<DrawerHeader>
<DrawerTitle>{t.title}</DrawerTitle>
<DrawerDescription>{t.description}</DrawerDescription>
</DrawerHeader>
<div className="p-4 pb-0">
<div className="flex items-center justify-center space-x-2">
<Button
variant="outline"
size="icon"
className="h-8 w-8 shrink-0 rounded-full"
onClick={() => onClick(-10)}
disabled={goal <= 200}
>
<Minus />
<span className="sr-only">{t.decrease}</span>
</Button>
<div className="flex-1 text-center">
<div className="text-7xl font-bold tracking-tighter">
{goal.toLocaleString(locale)}
</div>
<div className="text-muted-foreground text-[0.70rem] uppercase">
{t.caloriesPerDay}
</div>
</div>
<Button
variant="outline"
size="icon"
className="h-8 w-8 shrink-0 rounded-full"
onClick={() => onClick(10)}
disabled={goal >= 400}
>
<Plus />
<span className="sr-only">{t.increase}</span>
</Button>
</div>
<div className="mt-3 h-[120px]">
<ResponsiveContainer width="100%" height="100%">
<BarChart data={data}>
<XAxis
dataKey="goal"
tickLine={false}
tickMargin={10}
axisLine={false}
tickFormatter={(value) => value.toLocaleString(locale)}
reversed={dir === "rtl"}
/>
<Bar
dataKey="goal"
style={
{
fill: "var(--chart-2)",
} as React.CSSProperties
}
/>
</BarChart>
</ResponsiveContainer>
</div>
</div>
<DrawerFooter>
<Button>{t.submit}</Button>
<DrawerClose asChild>
<Button variant="outline">{t.cancel}</Button>
</DrawerClose>
</DrawerFooter>
</div>
</DrawerContent>
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does DrawerRtl() do?
DrawerRtl() is a function in the ui codebase, defined in apps/v4/examples/radix/drawer-rtl.tsx.
Where is DrawerRtl() defined?
DrawerRtl() is defined in apps/v4/examples/radix/drawer-rtl.tsx at line 110.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free