Locale
Locale provider for setting the locale and direction of the app.
Setup
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 'ark-ripple/locale';
export component App() {
<LocaleProvider locale="de-DE">{'/* Your App */'}</LocaleProvider>
}Usage
To access the current locale and direction settings, use the useLocaleContext hook.
import { useLocaleContext } from 'ark-ripple/locale';
export component Usage() {
const locale = useLocaleContext();
<pre>{JSON.stringify(@locale, null, 2)}</pre>
}API Reference
LocaleProvider
| Prop | Default | Type |
|---|---|---|
locale | 'en-US' | stringThe locale to use for the application. |