Config
LayoutApp-wide defaults for every component inside it, set once in the root layout instead of at each call site: the locale of the calendars, date fields, NumberInput and FileDropzone (defaultLocale), where floating parts portal to (defaultPortalTo), the reading direction (dir), and strings, the text Zest shows and reads out that isn't the app's content (close buttons, landmark names, "No results found."). Unset strings stay English. A Config inside another overrides only what it sets, and a component's own prop (closeLabel) wins over both.
import { Config } from '@limerdev/zest'; strings once.Examples
Swedish
One Config in the root layout sets the locale and the strings for every component in the app. Strings it leaves out stay English.
<script lang="ts">
import { Config, Field, NumberInput, Pagination } from '@limerdev/zest';
let page = $state(1);
let amount: number | null = $state(12500);
</script>
<Config
defaultLocale="sv-SE"
strings={{
pagination: 'Sidor',
previous: 'Föregående',
next: 'Nästa',
morePages: 'Fler sidor',
increase: 'Öka',
decrease: 'Minska'
}}
>
<div class="grid gap-6">
<Field.Root class="max-w-60">
<Field.Label>Belopp</Field.Label>
<NumberInput bind:value={amount} formatOptions={{ style: 'currency', currency: 'SEK' }} />
</Field.Root>
<Pagination.Root count={240} perPage={20} bind:page />
</div>
</Config> Props
Every part also takes class (merged over its defaults), ref (bindable: the element), children, and child (a snippet that
renders your own element, with props to spread on it).
Config
| Prop | Type | Default | Description |
|---|---|---|---|
| defaultLocale | string | the browser's | The locale of the calendars, date fields, NumberInput and FileDropzone inside, unless one sets its own (sv-SE). Bits UI's defaultLocale. |
| defaultPortalTo | string | Element | 'body' | Where the floating parts inside portal to: a selector or an element. Bits UI's defaultPortalTo. |
| dir | "ltr" | "rtl" | – | The reading direction of the components inside that take dir. |
| strings | StringOverrides | – | The strings Zest shows and reads out (close buttons, landmarks, empty lists), over those of the Config around it, then English. A component's own prop still wins. |