Default
import { PxlKitLocaleProvider } from '@pxlkit/ui-kit';
export function Default() {
return (
<PxlKitLocaleProvider locale="en">
<p>Hello, world!</p>
</PxlKitLocaleProvider>
);
}Sets the locale for every nested PxlKit component: lang on a layout-neutral wrapper, locale-aware upper/lower helpers and the matching Google Fonts URL.
import { PxlKitLocaleProvider } from '@pxlkit/ui-kit';| Prop | Type | Default | Description |
|---|---|---|---|
locale | 'en' | 'tr' | 'en' | BCP 47 locale tag. Default 'en'. |
children (required) | React.ReactNode | — | The part of the app that follows the locale. |
WCAG target: 2.1 AA
sets lang/dir context for descendants; no direct ARIAWraps its content in a layout-neutral element carrying lang (in Angular, the host element) so assistive tech and CSS text-transform pick up the correct language. In server-rendered apps (Next.js, Nuxt, Angular SSR), also set lang on the <html> tag.
import { PxlKitLocaleProvider } from '@pxlkit/ui-kit';
export function Default() {
return (
<PxlKitLocaleProvider locale="en">
<p>Hello, world!</p>
</PxlKitLocaleProvider>
);
}import { PxlKitLocaleProvider } from '@pxlkit/ui-kit';
export function Default() {
return (
<PxlKitLocaleProvider locale="en">
<p>Hello, world!</p>
</PxlKitLocaleProvider>
);
}import { PxlKitLocaleProvider } from '@pxlkit/ui-kit';
export function Turkish() {
return (
<PxlKitLocaleProvider locale="tr">
<p>İstanbul güneşli bir şehirdir</p>
</PxlKitLocaleProvider>
);
}