Layout

LocaleProvider

Context provider that supplies a shared locale and text direction default to locale-aware descendant components.

import { LocaleProvider } from '@lostgradient/cinder/locale-provider';
localeinternationalization
01

Overview

Shared locale and text-direction context for locale-aware descendants.

Usage

svelte
<script lang="ts">
  import LocaleProvider from '@lostgradient/cinder/locale-provider';
</script>

<LocaleProvider locale="de-DE">
  <!-- locale-aware cinder components -->
</LocaleProvider>
02

When to use

Use when
  • Setting one application or subtree locale for number, region, date, or time formatting.
  • Providing text direction once for direction-aware descendants while still allowing local overrides.
Avoid when
  • Only one component needs a non-default locale — pass that component's locale prop directly instead.
03

Props

Props for locale-provider
NameTypeDefaultDescription
locale text BCP 47 locale tag used as the default for locale-aware descendants.
direction 'ltr' | 'rtl' Text direction exposed to direction-aware descendants.
children snippet Descendant content that should inherit the locale context.