# UIProvider

Supply UI 1.1.0. Helpers.

The language of the kit's own words, and of its dates and numbers, set once in the root layout (see Every language, every direction, every eye)

The language of the kit's own words and of its dates and numbers, set once for the whole app, around its content in the root layout. Words left out stay English. Without `locale`, dates follow the page's `<html lang>`.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` (needed) | `ReactNode` |  | What goes inside. |
| `locale` | `string` |  | The language for dates and numbers, as a BCP 47 tag: `"de"`, `"en-GB"`. Left out, the page's `<html lang>` is used. |
| `messages` | `Partial<{ breadcrumb: string; pages: string; previousPage: string; nextPage: string; page: (n: number) => string; toolbar: string; previousMonth: string; nextMonth: string; month: string; year: string; endDate: string; clearDate: string; openCalendar: string; gallery: string; choosePage: string; previous: string; next: string; loading: string; search: string; searchPlaceholder: string; nothingFound: string; clear: string; showOptions: string; remove: (what: string) => string; less: string; more: string; capsLock: string; dropFile: string; chooseFile: string; files: string; code: string; copy: string; copied: string; colour: string; colourValue: (label: string) => string; pickFromScreen: string; readyColours: string; cropPicture: string; zoom: string; turnQuarter: string; mirror: string; resizePanel: string; mainMenu: string; openMenu: string; closeMenu: string; appearance: string; timeline: string; name: string; themeStyle: string; brandColour: string; greys: string; pageColour: string; pageWidth: string; fonts: string; lightOrDark: string; themeCode: string; done: string; notYet: string; unread: string; fileType: string; fileTooLarge: string; fileTooSmall: string; tooManyFiles: string; fileNotAdded: (name: string, reasons: string) => string; assistantAsk: string; allow: string; notNow: string; nothingChanged: string; undoAssistant: string; byAssistant: string; byTool: string; byYou: string; aControl: string; hidden: string; on: string; off: string; nothing: string; }>` |  | The kit's own words in that language, by key; the ones left out stay English. |

## Helpers: notes

Hooks and functions the components are made of, passed on so a project uses the same ones: keyboard shortcuts, options loaded while typing, search matching, saved preferences, screen-reader announcements, smooth sizes, the theme.

**Do**
- Use `useShortcut` for app-wide keys, and show the key with `formatShortcut` so it reads right on each computer.
- Use `announce()` to tell a screen reader what changed when nothing visible takes focus ("3 results").

**Don't**
- Don't turn off the smooth sizes `Toaster` starts; boxes would jump when their content changes.
