aymericzip/intlayer-skills / skills/intlayer-solid
intlayer-solid
VerifiedIntegrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", create a new translated component, use the "useIntlayer" hook in Solid, or configure providers.
| File | Kind | Size |
|---|---|---|
| LICENCE.md | markdown | 10.7 KB |
| SKILL.md | skill md | 3.3 KB |
| references/compiler.md | markdown | 14.6 KB |
| references/concept_collections.md | markdown | 5.6 KB |
| references/concept_variants.md | markdown | 20.9 KB |
| references/environment_solid-start.md | markdown | 53.3 KB |
| references/environment_tanstack-start_solid.md | markdown | 55.0 KB |
| references/environment_vite-and-solid.md | markdown | 41.1 KB |
| references/formatters.md | markdown | 17.3 KB |
| references/packages_solid-intlayer_IntlayerProvider.md | markdown | 1.9 KB |
| references/packages_solid-intlayer_exports.md | markdown | 5.0 KB |
| references/packages_solid-intlayer_useIntlayer.md | markdown | 1.9 KB |
| references/packages_solid-intlayer_useLocale.md | markdown | 1.8 KB |
| references/packages_solid-intlayer_usePathname.md | markdown | 3.4 KB |
| references/packages_solid-intlayer_useRewriteURL.md | markdown | 2.0 KB |
SKILL.md
View on GitHub---
name: intlayer-solid
description: Integrates Intlayer internationalization with SolidJS components. Use when the user asks to "setup SolidJS i18n", create a new translated component, use the "useIntlayer" hook in Solid, or configure providers.
metadata:
author: Intlayer
url: https://intlayer.org
license: Apache-2.0
mcp-server: "@intlayer/mcp"
category: productivity
tags: [i18n, solid, vite]
documentation: https://intlayer.org/doc
support: contact@intlayer.org
---
# Intlayer Solid 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 Solid 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 Solid component (e.g., `MyComponent.tsx`) using the `useIntlayer` hook.
### 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",
}),
},
} satisfies Dictionary;
export default content;
```
## Setup
- [Vite and Solid](references/environment_vite-and-solid.md)
- [SolidStart](references/environment_solid-start.md)
- [TanStack Start and Solid](references/environment_tanstack-start_solid.md)
## useIntlayer Hook
> [!IMPORTANT]
> In Solid, `useIntlayer` returns reactive content (e.g., `content`). You can access its properties directly.
```tsx
import { useIntlayer } from "solid-intlayer";
const MyComponent = () => {
const content = useIntlayer("my-component");
return (
<div>
<h1>
{/* Return content */}
{content.text}
</h1>
{/* Return string (.value) */}
<img src={content.text.value} alt={content.text.value} />
</div>
);
};
```
## 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 Solid](references/environment_vite-and-solid.md)
- [SolidStart](references/environment_solid-start.md)
- [TanStack Start and Solid](references/environment_tanstack-start_solid.md)
### Concepts
- [Variants](references/concept_variants.md)
- [Collections](references/concept_collections.md)
- [Compiler](references/compiler.md)
- [Formatters (number, currency, date, …)](references/formatters.md)
### Packages
- [Solid Intlayer Exports](references/packages_solid-intlayer_exports.md)
- [solid-intlayer IntlayerProvider](references/packages_solid-intlayer_IntlayerProvider.md)
- [solid-intlayer useIntlayer](references/packages_solid-intlayer_useIntlayer.md)
- [solid-intlayer useLocale](references/packages_solid-intlayer_useLocale.md)
- [solid-intlayer usePathname](references/packages_solid-intlayer_usePathname.md)
- [solid-intlayer useRewriteURL](references/packages_solid-intlayer_useRewriteURL.md)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |