Temporal Locale Provider
Defines the locale to use in the temporal components.
View as Markdown| L | M | M | J | V | S | D |
|---|---|---|---|---|---|---|
API reference
Import the component plus the date-fns library locale and wrap them around your app.
If every temporal component in your app shares the same locale, you should use the provider once at the root of your application.
Anatomy
import { fr } from 'date-fns/locale/fr';
import { UnstableTemporalLocaleProvider as TemporalLocaleProvider } from '@base-ui-components/react/temporal-locale-provider';
<TemporalLocaleProvider locale={fr}>
{/* Your app or a group of components */}
</TemporalLocaleProvider>localeLocale
en-US
localeLocale
en-US
- Name
- Description
The locale to use in temporal components.
- Type
Locale | undefined- Default
en-US
childrenReactNode
—
childrenReactNode
—- Name
- Type
React.ReactNode
Examples
Nesting locales
The <TemporalLocaleProvider> can be nested to change the locale for a part of the application.
This could be useful when you need some temporal components in your application to use a different locale than the rest of your app.
| L | M | M | J | V | S | D |
|---|---|---|---|---|---|---|
| 周 | 周 | 周 | 周 | 周 | 周 | 周 |
|---|---|---|---|---|---|---|