Concepts
OverviewCompositionTestingLayout
Aspect RatioBleedBoxCenterContainerDividerFlexFloatGridLink OverlayScrollableStackWrapComponents
AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTAModalDate PickerDialogFieldFieldsetFile UploaderIcon ButtonInputLoading StatesMenuNotificationsNumber InputPin InputProgressPrompt ModalRadioRatingSelectSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltipUtilities
Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFrameHighlightJSON Tree ViewLocaleLocal StoragePortalPresenceShowsplitPropsThemeA component that sets the locale for your app, formatting dates, numbers, and other locale-specific data.
The LocaleProvider component sets the locale for your app, formatting dates, numbers, and other locale-specific data.
Note: If no
LocaleProvideris setup, the default locale for the app will been-USand therefore the direction will beltr.
import { LocaleProvider } from '@cerberus/react'
export const App = () => { return <LocaleProvider locale="de-DE">{/* Your App */}</LocaleProvider>}To access the current locale and direction settings, use the useLocaleContext hook.
import { useLocaleContext } from '@cerberus/react'
export const Usage = () => { const { locale, dir } = useLocaleContext()
return <pre>{JSON.stringify({ locale, dir }, null, 2)}</pre>}LocaleProvider Props:
| Prop | Type | Required | Description |
|---|---|---|---|
locale | string | Yes | The locale to use for the application. |
On this page