Skip to content
Skills Library
Programming · Tool integration

intlayer-react

/intlayer-react

Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.

Repository
intlayer ↗
Licence
Apache-2.0
Last repository change
27.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
27
Scripts
0
HTML comments
0
URLs in SKILL.md
4
Deprecation

No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.

Triggers from the description

setup React i18nuseIntlayer
Original author description

Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.

How it works

  1. Core Philosophy
  2. Workflow
  3. Setup
  4. useIntlayer Hook
  5. Bundle Optimization
  6. Compiler
  7. References
Original SKILL.md headings · 114 lines, 385 words
SKILL.md preview
---
name: intlayer-react
description: Integrates Intlayer internationalization with React component. Use when the user asks to "setup React i18n", create a new translated component, use the "useIntlayer" hook, or configure providers.
metadata:
  author: Intlayer
  url: https://intlayer.org
  license: Apache-2.0
  mcp-server: "@intlayer/mcp"
  category: productivity
  tags: [i18n, react, vite]
  documentation: https://intlayer.org/doc
  support: contact@intlayer.org
---

# Intlayer React Usage

## Core Philosophy

Intlayer promotes **Component-Level Content Declaration**. Instead of a massive global translation file, content is declared in `*.content.ts` files adjacent to the React components that use them.

## Workflow

To create a translated component, you need two files:

1.  **Declaration:** A content file (e.g., `myComponent.content.ts`) defining the dictionary.
2.  **Implementation:** A React component (e.g., `MyComponent.tsx`) using the `useIntlayer` hook.

### 1. Declare Content

Create a content file using `t()` for translations.
**File:** `src/components/MyComponent/myComponent.content.ts`

```typescript
import { t, type Dictionary } from "intlayer";

const content = {
  // The 'key' must be unique and matches what you pass to useIntlayer()
  key: "my-component",
  content: {
    text: t({
      en: "Welcome",
      fr: "Bienvenue",
      es: "Hola",
      // ... All other locales set in intlayer config file
    }),
  },
} satisfies Dictionary;

export default content;
```

## Setup

- [Vite and React](references/environment_vite-and-react.md)
- [Create React App](references/environment_create-react-app.md)
- [React Router v7](references/environment_vite-and-react_react-router-v7.md)
- [Tanstack Start](references/environment_tanstack-start.md)
- [React Native and Expo](references/environment_react-native-and-expo.md)
- [Lynx and React](references/environment_lynx-and-react.md)
- [Storybook](references/storybook.md)

## useIntlayer Hook

```tsx
import { useIntlayer } from "react-intlayer";
const MyComponent = () => {
  const content = useIntlayer("my-dictionary-key");
  return (
    <div>
      <h1>
        {/* Return react node */}
        {content.text}
      </h1>
      {/* Return string (.value) */}
      <img src={content.text.value} alt={content.text.value} />
    </div>
  );
};
```

## Bundle Optimization

Read content fields by name (dot access or destructuring) so the build can purge and minify the dictionary. Never index content at runtime (`content.statuses[status]`, use `select()`), and call `useIntlayer` in each child component instead of passing content as a prop. See the `intlayer-bundle-optimization` skill.

## Compiler

The [Intlayer Compiler](references/compiler.md) can extract all your content keys from your components, using one CLI command (`npx intlayer extract`) or automatically at app build.

## References

- [Website](https://intlayer.org)
- [Doc](https://intlayer.org/doc)

### Environments

- [Vite and React](references/environment_vite-and-react.md)
- [Create React App](references/environment_create-react-app.md)
- [Vite and React (React Router v7)](references/environment_vite-and-react_react-router-v7.md)
- [Tanstack Start](references/environment_tanstack-start.md)
- [React Native and Expo](references/environment_react-native-and-expo.md)
- [Lynx and React](references/environment_lynx-and-react.md)
- [Astro and React](references/environment_astro_react.md)
- [Storybook](references/storybook.md)

### Concepts

- [Variants](references/concept_variants.md)
- [Collections](references/concept_collections.md)
- [Compiler](references/compiler.md)
- [Formatters (number, currency, date, …)](references/formatters.md)

### Packages

- [Intlayer Exports](references/packages_intlayer_exports.md)
- [React Intlayer Provider](references/packages_react-intlayer_IntlayerProvider.md)
- [React Intlayer MarkdownRenderer](references/packages_react-intlayer_MarkdownRenderer.md)
- [React Intlayer Exports](references/packages_react-intlayer_exports.md)
- [React Intlayer T](references/packages_react-intlayer_t.md)
- [React Intlayer useDictionary](references/packages_react-intlayer_useDictionary.md)
- [React Intlayer useI18n](references/packages_react-intlayer_useI18n.md)
- [React Intlayer useIntlayer](references/packages_react-intlayer_useIntlayer.md)
- [React Intlayer useLocale](references/packages_react-intlayer_useLocale.md)
- [lynx-intlayer Exports](references/packages_lynx-intlayer_exports.md)
- [react-intlayer usePathname](references/packages_react-intlayer_usePathname.md)
- [react-intlayer useRewriteURL](references/packages_react-intlayer_useRewriteURL.md)
- [react-native-intlayer Exports](references/packages_react-native-intlayer_exports.md)
Files in this package (27)
  • LICENCE.md 11 KB
  • SKILL.md 5 KB
  • references/compiler.md 15 KB
  • references/concept_collections.md 6 KB
  • references/concept_variants.md 21 KB
  • references/environment_astro_react.md 38 KB
  • references/environment_create-react-app.md 39 KB
  • references/environment_lynx-and-react.md 15 KB
  • references/environment_react-native-and-expo.md 30 KB
  • references/environment_tanstack-start.md 57 KB
  • references/environment_vite-and-react.md 52 KB
  • references/environment_vite-and-react_react-router-v7.md 47 KB
  • references/formatters.md 17 KB
  • references/packages_intlayer_exports.md 12 KB
  • references/packages_lynx-intlayer_exports.md 1 KB
  • references/packages_react-intlayer_IntlayerProvider.md 2 KB
  • references/packages_react-intlayer_MarkdownRenderer.md 1 KB
  • references/packages_react-intlayer_exports.md 14 KB
  • references/packages_react-intlayer_t.md 6 KB
  • references/packages_react-intlayer_useDictionary.md 2 KB
  • references/packages_react-intlayer_useI18n.md 5 KB
  • references/packages_react-intlayer_useIntlayer.md 2 KB
  • references/packages_react-intlayer_useLocale.md 3 KB
  • references/packages_react-intlayer_usePathname.md 3 KB
  • references/packages_react-intlayer_useRewriteURL.md 2 KB
  • references/packages_react-native-intlayer_exports.md 5 KB
  • references/storybook.md 16 KB

Versions

The database has no other skills named intlayer-react.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 49476d1d7740 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100intlayer-preact
    Integrates Intlayer internationalization with Preact applications. Use when the user asks to "setup Preact i18n", create a new translated component, use the "useIntlayer" hook in Preact, or configure providers.
  • 100intlayer-svelte
    Integrates Intlayer internationalization with Svelte and SvelteKit applications. Use when the user asks to "setup Svelte i18n", create a new translated component, use the "useIntlayer" store, or configure providers.
  • 100react
    Use when creating or editing frontend React code in react-ui or ui-components packages. Triggers on any frontend component, hook, or UI work.
  • 96react-component-generator
    生成符合项目规范的 React 组件。当用户要求创建组件、新建 React 组件或生成组件文件时使用
  • 100react-hook-creator
    Create react hook creator operations. Auto-activating skill for Frontend Development. Triggers on: react hook creator, react hook creator Part of the Frontend Development skill category. Use when working with react hook creator functionality. Trigger with phrases like "react…
  • 100react-component-guidelines
    Guidelines for writing React components. Use this when creating a new react component.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.