--- createdAt: 2025-02-07 updatedAt: 2026-09-27 priority: 8 title: "Markdown Content in Intlayer" description: "Declare translated Markdown in Intlayer with md() or .content.md files, and render it with your own components in any framework." keywords: - Markdown - Internationalization - Documentation - Intlayer - Next.js - JavaScript - React - Remix - Astro slugs: - doc - concept - content - markdown history: - version: 8.11.0 date: 2026-05-28 changes: "Automatic decoration of markdown content, MDX and SSR support" - version: 8.10.0 date: 2026-05-19 changes: "Add `.content.md` files support" - version: 8.5.0 date: 2026-03-24 changes: "Add `intlayerMarkdown` plugin object; use `app.use(intlayerMarkdown)` instead of `app.use(installIntlayerMarkdown)`" - version: 8.5.0 date: 2026-03-24 changes: "move import from `{{framework}}-intlayer` to `{{framework}}-intlayer/markdown`" - version: 8.0.0 date: 2026-01-22 changes: "Add MarkdownRenderer / useMarkdownRenderer / renderMarkdown utility and forceInline option" - version: 8.0.0 date: 2026-01-18 changes: "Automatic decoration of markdown content, MDX and SSR support" - version: 5.5.10 date: 2025-06-29 changes: "Init history" author: aymericzip --- # Markdown / Rich Text Content Intlayer supports rich text content defined using Markdown syntax. This allows you to easily write and maintain content with rich formatting, such as blogs, articles, and more. ## Declaring Markdown Content You can declare Markdown content using the `md` function or simply as a string (if it contains Markdown syntax). Since version `8.10.0`, you can declare Markdown content directly in `.content.md` files. Intlayer will automatically detect and parse the Markdown content. ```md fileName="markdown-file.en.content.md" --- key: my-markdown-content description: My content locale: en --- # My content Here an example of markdown content ``` The `locale` front-matter field is the field that define the locale of the content. It is optional. If not provided, Intlayer will use the default locale, which is also used as fallback locale if no translation is available for a specific locale. Example of file structure: ```text content ├── markdown-file.en.content.md ├── markdown-file.fr.content.md └── markdown-file.es.content.md ``` You can add in front-matter any properties defined in the [Dictionary definition](https://github.com/aymericzip/intlayer/blob/main/docs/docs/en/dictionary/content_file.md) Use the `md` function to explicitly declare Markdown content. This is useful if you want to ensure a string is treated as Markdown even if it doesn't contain obvious syntax. ```typescript fileName="markdownDictionary.content.ts" import { md, type Dictionary } from "intlayer"; const markdownDictionary = { key: "app", content: { myMarkdownContent: md("## My title \n\nLorem Ipsum"), }, } satisfies Dictionary; export default markdownDictionary; ``` Import `.md` files directly using the `file` function. ```typescript fileName="markdownDictionary.content.ts" import { md, file, t } from "intlayer"; export default { key: "app", content: { content: t({ en: md(file("./myMarkdown.en.md")), fr: md(file("./myMarkdown.fr.md")), }), }, }; ``` If the string contains common Markdown indicators (like headers, lists, links, etc.), Intlayer will automatically transform it. ```typescript fileName="markdownDictionary.content.ts" export default { key: "app", contentAutoTransformation: true, // Enable automatic detection of Markdown content - Can be set globally in intlayer.config.ts content: { myMarkdownContent: "## My title \n\nLorem Ipsum", }, }; ``` ## Rendering Markdown Intlayer provides two independent ways to render Markdown: 1. **Via `useIntlayer`** Intlayer automatically transforms the `md` node into the framework's native output (JSX, VNode, HTML string). - Frontmatter is parsed and exposed as `.metadata`. You can override rendering at two levels, globally with `MarkdownProvider` (or the framework equivalent) and locally per-node with `.use()`. Both can be combined; `.use()` takes priority over `MarkdownProvider`, which takes priority over the default. 2. **Helper utilities**: ``, `useMarkdownRenderer()`, and `renderMarkdown()` are standalone tools that accept **raw Markdown strings only**. They are independent of `useIntlayer` and do not work with the decorated nodes it returns. Markdown rendering supports **MDX**. Use any JSX/framework component by name directly in your Markdown. ### 1. Automatic Rendering (via `useIntlayer`) Markdown nodes can be rendered directly as JSX. ```tsx fileName="App.tsx" import { useIntlayer } from "react-intlayer"; import { MarkdownProvider } from "react-intlayer/markdown"; const AppContent = () => { const { myMarkdownContent } = useIntlayer("app"); return
{myMarkdownContent}
; }; const App = () => (

{children}

, MyButton: (props) =>