FUNSTACK UI has no DirectionProvider and no LocaleProvider. Direction comes from the page, the way the browser reads it; a locale is a plain prop on the Root of each component that formats numbers.
dir is the only switch. Set it where the platform expects it: <html dir="rtl">, a container, or a part itself (every part passes native attributes through, so <Tabs.List dir="rtl"> works). Each component reads the computed CSS direction of the relevant element (the table below) when a key is pressed or a gesture starts, so nothing is needed at render and Server Components and the server HTML are unaffected.
// <html lang="ar" dir="rtl"> in your document, then no setup:
<Tabs.Root defaultValue="a">
<Tabs.List>…</Tabs.List> {/* ArrowLeft moves to the next tab */}
</Tabs.Root>dir, the attribute the browser already uses for layout, logical properties, :dir() and anchor positioning. Libraries that have one ask you to set both, and when the two disagree the arrow keys and the layout point different ways. Reading the CSS cannot disagree with the layout, and a page with <html dir="rtl"> needs no setup at all.side="inline-start" / "inline-end" and align="start" / "end" use anchor-positioning keywords that resolve against the popup's direction. Drawer's side takes "inline-start" / "inline-end" too.locale="ar" on a NumberField changes its digits and separators, not its layout.Only ArrowLeft and ArrowRight in a horizontal orientation swap. ArrowUp / ArrowDown, Home / End, PageUp / PageDown and every vertical orientation do the same under RTL as under LTR. writing-mode is not read.
| Component | What follows direction | Read from |
|---|---|---|
| Tabs | ArrowLeft / ArrowRight between tabs (horizontal list) | the List |
| ToggleGroup, Toolbar | ArrowLeft / ArrowRight between items (horizontal) | the Root |
| Menubar | ArrowLeft / ArrowRight between Triggers, and from an item of an open menu to the next or previous menu | the Menubar |
| Slider | ArrowLeft / ArrowRight follow the mirrored track (Right decreases); the value under the pointer | the thumb's input; the Track |
| Menu | the arrow that opens and closes a submenu (the inline-end one); the open key of a Trigger in a vertical Toolbar; which edge of a menu opened at a point sits at the pointer; the wheel hand-off of a horizontal scroller | the popup or its parent popup; the Trigger; the scroller |
Combobox multiple | the inline-start arrow from the input to the chips, and arrows between chips | the input; the chip |
| Drawer | which way an inline-start / inline-end drawer swipes closed | the dialog |
| Tooltip, Popover, HoverCard, Menu, Select, Combobox, MultiSelect | logical sides and alignment; data-side / data-align report where the popup is | CSS anchor positioning |
| RadioGroup | arrows between radios (native; not in Safari, below) | the browser |
| OTPField | nothing: the Root is ltr by default (below) | – |
| Accordion, NumberField | nothing: vertical keys only | – |
<html dir> matches is unaffected, and the library ships no workaround.A one-time code is read left to right in every locale, so OTPField.Root renders dir="ltr" unless you pass dir: inside an RTL page Slot 0 stays the leftmost box and ArrowLeft moves to the previous character. The label and the messages outside the Root follow the page. Without the attribute the boxes would mirror while the input's text would not, and the engines disagree on the arrow keys there. See OTPField.
Components that format or parse numbers take a locale prop on their Root: NumberField, Progress and Meter. The type is string | readonly string[], what the Intl constructors take (a list is a preference order). The parts get the formatter from the Root.
<html lang> names another language and no locale was given.navigator.language and never derives the locale from lang.Progress.Root and Meter.Root have no "use client" directive, so a Server Component renders them once, on the server. A context cannot reach them there, so a provider would silently not apply to them. And an app that localises already has a locale source, its i18n library; a second provider would have to be kept in step with it. The question is reopened by the first date or time component.
Wrap the Root once in a client component that reads the locale from your i18n library, and use the wrapper everywhere:
"use client";
import { NumberField } from "@funstack/ui/number-field";
import type { ComponentProps } from "react";
import { useLocale } from "./i18n"; // your i18n library's hook
export function NumberFieldRoot(props: ComponentProps<typeof NumberField.Root>) {
const locale = useLocale();
return <NumberField.Root locale={locale} {...props} />;
}locale is plain data, so a Server Component passes it directly. Progress and Meter then format on the server, with nothing to mismatch:
import { Progress } from "@funstack/ui/progress";
import { getLocale } from "./i18n/server"; // however your server knows the request's locale
export async function UploadStatus({ done }: { done: number }) {
const locale = await getLocale(); // for example "ar-EG" or ["de-CH", "de"]
return (
<Progress.Root value={done} locale={locale} aria-label="Upload">
<Progress.Value />
<Progress.Track><Progress.Indicator /></Progress.Track>
</Progress.Root>
);
}A few parts have an English default text, each with its own override; there is no strings provider either.
| Component | Default | Override |
|---|---|---|
| Combobox | "No results", "1 result", "N results"; "Japan removed" with multiple | announce, announceRemoved on the Root |
| Toast | "Notifications (F8)", the Viewport's name | aria-label on Toast.Viewport |
| NumberField | "Increase" / "Decrease", the first word of the buttons' names (the label follows: "Increase Quantity") | aria-label on Increment / Decrement |