import { PixxlProvider } from "@pixxl-tools/components";
// In Server Components:
import { PixxlProvider } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
locale | string | en-US | BCP 47 locale for messages, Intl formatting and lang (default en-US). |
messages | LocaleProviderProps["messages"] | — | Message overrides (partial catalog or list), e.g. messages={pl} with import { pl } from "@pixxl-tools/components/locales/pl". Missing keys fall back to English; explicit component props always win. |
theme | PixxlTheme | <html> | Theme applied to themeTarget (default <html>). Omit it to leave the document theme alone — e.g. when <ThemeScript /> manages it. |
accent | AccentPresetName | — | Accent preset for this subtree (data-accent). Any custom accent can be set with the --pixxl-accent CSS variable instead. |
catalogs | LocaleProviderProps["catalogs"] | — | Catalogs by tag or language; the one for locale is used (see LocaleProvider). |
density | "comfortable" | "compact" | — | UI density for this subtree (data-density). |
direction | PixxlDirection | — | Writing direction (dir) of the subtree. Default: the direction of locale when it is set, otherwise none, so the document's dir applies. |
linkComponent | PixxlLinkComponent | — | Router link used by every navigating link in the subtree (Link, ActionLink, Breadcrumbs, SideNav, NavigationMenu, SiteHeader, menu items with href, …): linkComponent={NextLink} from next/link. It gets href, className, children, aria-current, handlers and ref. A component's own renderLink / asChild wins over it. |
themeAttribute | string | — | Extra attribute mirroring the resolved theme ("class" → dark/light). |
themeTarget | HTMLElement | null | — | Element that receives theme (omitted: <html>; null: none yet). |
localedefault en-USstring
BCP 47 locale for messages, Intl formatting and lang (default en-US).
messagesLocaleProviderProps["messages"]
Message overrides (partial catalog or list), e.g. messages={pl} with import { pl } from "@pixxl-tools/components/locales/pl". Missing keys fall back to English; explicit component props always win.
themedefault <html>PixxlTheme
Theme applied to themeTarget (default <html>). Omit it to leave the document theme alone — e.g. when <ThemeScript /> manages it.
accentAccentPresetName
Accent preset for this subtree (data-accent). Any custom accent can be set with the --pixxl-accent CSS variable instead.
catalogsLocaleProviderProps["catalogs"]
Catalogs by tag or language; the one for locale is used (see LocaleProvider).
density"comfortable" | "compact"
UI density for this subtree (data-density).
directionPixxlDirection
Writing direction (dir) of the subtree. Default: the direction of locale when it is set, otherwise none, so the document's dir applies.
linkComponentPixxlLinkComponent
Router link used by every navigating link in the subtree (Link, ActionLink, Breadcrumbs, SideNav, NavigationMenu, SiteHeader, menu items with href, …): linkComponent={NextLink} from next/link. It gets href, className, children, aria-current, handlers and ref. A component's own renderLink / asChild wins over it.
themeAttributestring
Extra attribute mirroring the resolved theme ("class" → dark/light).
themeTargetHTMLElement | null
Element that receives theme (omitted: <html>; null: none yet).
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
import { pl } from "@pixxl-tools/components/locales/pl";
<PixxlProvider theme="system" locale="pl-PL" messages={pl}>...</PixxlProvider>