Author:
    Creation:2026-01-21Last update:2026-01-21

    preact-intlayer Package

    The preact-intlayer package provides the necessary tools to integrate Intlayer into Preact applications. It includes providers and hooks for handling multilingual content.

    Installation

    bash
    npm install preact-intlayer
    

    Exports

    Provider

    ComponentDescription
    IntlayerProviderThe main provider that wraps your application and provides the Intlayer context.

    Hooks

    HookDescriptionRelated Doc
    useIntlayerBased on useDictionary, but injects an optimized version of the dictionary from the generated declaration.-
    useDictionaryProcesses objects that look like dictionaries (key, content). It processes t() translations, enumerations, etc.-
    useLocaleReturns the current locale and a function to set it.-
    usePathnameHook that returns the current pathname with the locale segment removed. Reactive to browser navigation via popstate.usePathname
    tPicks content based on the current locale.translation

    Components

    ComponentDescription
    MarkdownProviderProvider for markdown rendering context.
    MarkdownRendererRenders markdown content with custom components.