"use client";
import { LocaleProvider } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
locale | string | — | BCP 47 locale for messages and Intl formatting (default: the parent provider's, else en-US). |
messages | PixxlMessagesInput | readonly PixxlMessagesInput[] | — | Message overrides on top of catalogs: one partial catalog or a list merged left to right ([pl, { pagination: { next: "Dalej" } }]). Nested providers with the same language inherit them. Keep the value stable (module constant or memo) to avoid re-rendering every consumer. |
catalogs | PixxlMessageCatalogs | — | Catalogs keyed by BCP 47 tag or language ({ pl, "pt-BR": ptBR }). The catalog for locale is picked automatically: language first, then the exact tag on top; English fills in anything missing. |
children | ReactNode | — | — |
direction | PixxlDirection | — | Text direction (default: the parent provider's, else ltr). |
localestring
BCP 47 locale for messages and Intl formatting (default: the parent provider's, else en-US).
messagesPixxlMessagesInput | readonly PixxlMessagesInput[]
Message overrides on top of catalogs: one partial catalog or a list merged left to right ([pl, { pagination: { next: "Dalej" } }]). Nested providers with the same language inherit them. Keep the value stable (module constant or memo) to avoid re-rendering every consumer.
catalogsPixxlMessageCatalogs
Catalogs keyed by BCP 47 tag or language ({ pl, "pt-BR": ptBR }). The catalog for locale is picked automatically: language first, then the exact tag on top; English fills in anything missing.
childrenReactNode
directionPixxlDirection
Text direction (default: the parent provider's, else ltr).
import { pl } from "@pixxl-tools/components/locales/pl";
<LocaleProvider locale="pl-PL" messages={[pl, { pagination: { next: "Dalej" } }]}>
<Pagination pageCount={12} />
</LocaleProvider>