`要素のデフォルトですが、それ以外の場合は指定する必要があります。
+
+## 例
+
+### レスポンシブ
+
+
+
+```jsx
+import Image from 'next/image'
+import mountains from '../public/mountains.jpg'
+
+export default function Responsive() {
+ return (
+
+
+
+ )
+}
+```
+
+### コンテナを埋める
+
+
+
+```jsx
+import Image from 'next/image'
+import mountains from '../public/mountains.jpg'
+
+export default function Fill() {
+ return (
+
+
+
+
+ {/* グリッド内の他の画像... */}
+
+ )
+}
+```
+
+### 背景画像
+
+
+
+```jsx
+import Image from 'next/image'
+import mountains from '../public/mountains.jpg'
+
+export default function Background() {
+ return (
+
+ )
+}
+```
+
+さまざまなスタイルで使用されたImageコンポーネントの例については、[Image Component Demo](https://image-component.nextjs.gallery)を参照してください。
+
+## その他のプロパティ
+
+[**`next/image`コンポーネントで利用可能なすべてのプロパティを表示します。**](/docs/app/api-reference/components/image)
+
+## 設定
+
+`next/image`コンポーネントとNext.js画像最適化APIは、[`next.config.js`ファイル](/docs/app/api-reference/next-config-js)で設定できます。これらの設定により、[リモート画像を有効に](/docs/app/api-reference/components/image#remotepatterns)したり、[カスタム画像ブレークポイントを定義](/docs/app/api-reference/components/image#devicesizes)したり、[キャッシュ動作を変更](/docs/app/api-reference/components/image#caching-behavior)したりできます。
+
+[**詳細については、完全な画像設定ドキュメントをお読みください。**](/docs/app/api-reference/components/image#configuration-options)
\ No newline at end of file
diff --git a/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/02-fonts.mdx b/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/02-fonts.mdx
new file mode 100644
index 00000000..e68a7808
--- /dev/null
+++ b/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/02-fonts.mdx
@@ -0,0 +1,644 @@
+---
+source-updated-at: 2025-05-16T04:52:11.000Z
+translation-updated-at: 2025-06-06T17:27:01.078Z
+title: フォント最適化
+nav_title: フォント
+description: 組み込みの `next/font` ローダーを使用してアプリケーションのウェブフォントを最適化します。
+related:
+ title: APIリファレンス
+ description: next/font APIの詳細を学びます。
+ links:
+ - app/api-reference/components/font
+---
+
+{/* このドキュメントの内容はApp RouterとPages Routerで共有されています。Pages Router固有のコンテンツを追加するには`
コンテンツ`コンポーネントを使用します。共有コンテンツはコンポーネントでラップしないでください。 */}
+
+[**`next/font`**](/docs/app/api-reference/components/font) はフォント(カスタムフォントを含む)を自動的に最適化し、プライバシーとパフォーマンスを向上させるために外部ネットワークリクエストを削除します。
+
+> **🎥 動画で学ぶ:** `next/font` の使用方法 → [YouTube (6分)](https://www.youtube.com/watch?v=L8_98i_bMMA)
+
+`next/font` には、あらゆるフォントファイルの**組み込み自動セルフホスティング**が含まれています。これは、基盤となるCSSの `size-adjust` プロパティのおかげで、レイアウトシフトをゼロに抑えながらウェブフォントを最適に読み込めることを意味します。
+
+この新しいフォントシステムでは、パフォーマンスとプライバシーを考慮して、すべてのGoogleフォントを便利に使用できます。CSSとフォントファイルはビルド時にダウンロードされ、他の静的アセットと一緒にセルフホストされます。**ブラウザからGoogleにリクエストが送信されることはありません。**
+
+## Googleフォント
+
+任意のGoogleフォントを自動的にセルフホストできます。フォントはデプロイに含まれ、デプロイと同じドメインから提供されます。**ブラウザからGoogleにリクエストが送信されることはありません。**
+
+使用したいフォントを `next/font/google` から関数としてインポートします。最高のパフォーマンスと柔軟性を得るために、[可変フォント](https://fonts.google.com/variablefonts)の使用を推奨します。
+
+
+
+```tsx filename="app/layout.tsx" switcher
+import { Inter } from 'next/font/google'
+
+// 可変フォントを読み込む場合、フォントの重さを指定する必要はありません
+const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import { Inter } from 'next/font/google'
+
+// 可変フォントを読み込む場合、フォントの重さを指定する必要はありません
+const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export default function RootLayout({ children }) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+可変フォントを使用できない場合は、**重さを指定する必要があります**:
+
+```tsx filename="app/layout.tsx" switcher
+import { Roboto } from 'next/font/google'
+
+const roboto = Roboto({
+ weight: '400',
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import { Roboto } from 'next/font/google'
+
+const roboto = Roboto({
+ weight: '400',
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export default function RootLayout({ children }) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+
+
+
+
+すべてのページでフォントを使用するには、以下のように `/pages` 配下の [`_app.js` ファイル](/docs/pages/building-your-application/routing/custom-app) に追加します:
+
+```jsx filename="pages/_app.js"
+import { Inter } from 'next/font/google'
+
+// 可変フォントを読み込む場合、フォントの重さを指定する必要はありません
+const inter = Inter({ subsets: ['latin'] })
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+
+
+
+ )
+}
+```
+
+可変フォントを使用できない場合は、**重さを指定する必要があります**:
+
+```jsx filename="pages/_app.js"
+import { Roboto } from 'next/font/google'
+
+const roboto = Roboto({
+ weight: '400',
+ subsets: ['latin'],
+})
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+
+
+
+ )
+}
+```
+
+
+
+配列を使用して複数の重さやスタイルを指定できます:
+
+```jsx filename="app/layout.js"
+const roboto = Roboto({
+ weight: ['400', '700'],
+ style: ['normal', 'italic'],
+ subsets: ['latin'],
+ display: 'swap',
+})
+```
+
+> **知っておくと良いこと**: 複数の単語を含むフォント名にはアンダースコア(_)を使用します。例: `Roboto Mono` は `Roboto_Mono` としてインポートします。
+
+
+
+### `` にフォントを適用
+
+ラッパーや `className` を使用せずに、`` 内にフォントを注入することもできます:
+
+```jsx filename="pages/_app.js"
+import { Inter } from 'next/font/google'
+
+const inter = Inter({ subsets: ['latin'] })
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+### 単一ページでの使用
+
+特定のページでフォントを使用するには、以下のようにそのページに追加します:
+
+```jsx filename="pages/index.js"
+import { Inter } from 'next/font/google'
+
+const inter = Inter({ subsets: ['latin'] })
+
+export default function Home() {
+ return (
+
+ )
+}
+```
+
+
+
+### サブセットの指定
+
+Googleフォントは自動的に[サブセット化](https://fonts.google.com/knowledge/glossary/subsetting)されます。これによりフォントファイルのサイズが縮小され、パフォーマンスが向上します。プリロードするサブセットを定義する必要があります。[`preload`](/docs/app/api-reference/components/font#preload) が `true` なのにサブセットを指定しないと警告が表示されます。
+
+関数呼び出しに追加することで指定できます:
+
+
+
+```tsx filename="app/layout.tsx" switcher
+const inter = Inter({ subsets: ['latin'] })
+```
+
+```jsx filename="app/layout.js" switcher
+const inter = Inter({ subsets: ['latin'] })
+```
+
+
+
+
+
+```jsx filename="pages/_app.js"
+const inter = Inter({ subsets: ['latin'] })
+```
+
+
+
+詳細は[フォントAPIリファレンス](/docs/app/api-reference/components/font)をご覧ください。
+
+### 複数のフォントを使用
+
+アプリケーションで複数のフォントをインポートして使用できます。2つのアプローチがあります。
+
+1つ目のアプローチは、フォントをエクスポートし、インポートして必要な場所に `className` を適用するユーティリティ関数を作成する方法です。これにより、フォントがレンダリングされるときにのみプリロードされます:
+
+```ts filename="app/fonts.ts" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+
+export const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ display: 'swap',
+})
+```
+
+```js filename="app/fonts.js" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+
+export const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+})
+
+export const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ display: 'swap',
+})
+```
+
+
+
+```tsx filename="app/layout.tsx" switcher
+import { inter } from './fonts'
+
+export default function Layout({ children }: { children: React.ReactNode }) {
+ return (
+
+
+ {children}
+
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import { inter } from './fonts'
+
+export default function Layout({ children }) {
+ return (
+
+
+ {children}
+
+
+ )
+}
+```
+
+```tsx filename="app/page.tsx" switcher
+import { roboto_mono } from './fonts'
+
+export default function Page() {
+ return (
+ <>
+ My page
+ >
+ )
+}
+```
+
+```jsx filename="app/page.js" switcher
+import { roboto_mono } from './fonts'
+
+export default function Page() {
+ return (
+ <>
+ My page
+ >
+ )
+}
+```
+
+
+
+上記の例では、`Inter` はグローバルに適用され、`Roboto Mono` は必要に応じてインポートして適用できます。
+
+別の方法として、[CSS変数](/docs/app/api-reference/components/font#variable)を作成し、好みのCSSソリューションで使用できます:
+
+
+
+```tsx filename="app/layout.tsx" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+import styles from './global.css'
+
+const inter = Inter({
+ subsets: ['latin'],
+ variable: '--font-inter',
+ display: 'swap',
+})
+
+const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ variable: '--font-roboto-mono',
+ display: 'swap',
+})
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+
+ My App
+ {children}
+
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+
+const inter = Inter({
+ subsets: ['latin'],
+ variable: '--font-inter',
+ display: 'swap',
+})
+
+const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ variable: '--font-roboto-mono',
+ display: 'swap',
+})
+
+export default function RootLayout({ children }) {
+ return (
+
+
+ My App
+ {children}
+
+
+ )
+}
+```
+
+
+
+```css filename="app/global.css"
+html {
+ font-family: var(--font-inter);
+}
+
+h1 {
+ font-family: var(--font-roboto-mono);
+}
+```
+
+上記の例では、`Inter` がグローバルに適用され、すべての `
` タグが `Roboto Mono` でスタイルされます。
+
+> **推奨事項**: 新しいフォントごとにクライアントがダウンロードする必要があるリソースが増えるため、複数のフォントの使用は控えめにしてください。
+
+## ローカルフォント
+
+`next/font/local` をインポートし、ローカルフォントファイルの `src` を指定します。最高のパフォーマンスと柔軟性を得るために、[可変フォント](https://fonts.google.com/variablefonts)の使用を推奨します。
+
+
+
+```tsx filename="app/layout.tsx" switcher
+import localFont from 'next/font/local'
+
+// フォントファイルは `app` 内に配置できます
+const myFont = localFont({
+ src: './my-font.woff2',
+ display: 'swap',
+})
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import localFont from 'next/font/local'
+
+// フォントファイルは `app` 内に配置できます
+const myFont = localFont({
+ src: './my-font.woff2',
+ display: 'swap',
+})
+
+export default function RootLayout({ children }) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+
+
+
+
+```jsx filename="pages/_app.js"
+import localFont from 'next/font/local'
+
+// フォントファイルは `pages` 内に配置できます
+const myFont = localFont({ src: './my-font.woff2' })
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+
+
+
+ )
+}
+```
+
+
+
+単一のフォントファミリーに複数のファイルを使用したい場合、`src` は配列にできます:
+
+```js
+const roboto = localFont({
+ src: [
+ {
+ path: './Roboto-Regular.woff2',
+ weight: '400',
+ style: 'normal',
+ },
+ {
+ path: './Roboto-Italic.woff2',
+ weight: '400',
+ style: 'italic',
+ },
+ {
+ path: './Roboto-Bold.woff2',
+ weight: '700',
+ style: 'normal',
+ },
+ {
+ path: './Roboto-BoldItalic.woff2',
+ weight: '700',
+ style: 'italic',
+ },
+ ],
+})
+```
+
+詳細は[フォントAPIリファレンス](/docs/app/api-reference/components/font)をご覧ください。
+
+## Tailwind CSSとの併用
+
+`next/font` は[CSS変数](/docs/app/api-reference/components/font#css-variables)を通じて[Tailwind CSS](https://tailwindcss.com/)と併用できます。
+
+以下の例では、`next/font/google` から `Inter` フォントを使用します(Googleフォントまたはローカルフォントのいずれでも使用可能です)。`variable` オプションでフォントを読み込み、CSS変数名を定義して `inter` に割り当てます。次に、`inter.variable` を使用してHTMLドキュメントにCSS変数を追加します。
+
+
+
+```tsx filename="app/layout.tsx" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+
+const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+ variable: '--font-inter',
+})
+
+const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ display: 'swap',
+ variable: '--font-roboto-mono',
+})
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import { Inter, Roboto_Mono } from 'next/font/google'
+
+const inter = Inter({
+ subsets: ['latin'],
+ display: 'swap',
+ variable: '--font-inter',
+})
+
+const roboto_mono = Roboto_Mono({
+ subsets: ['latin'],
+ display: 'swap',
+ variable: '--font-roboto-mono',
+})
+
+export default function RootLayout({ children }) {
+ return (
+
+ {children}
+
+ )
+}
+```
+
+
+
+
+
+```jsx filename="pages/_app.js"
+import { Inter } from 'next/font/google'
+
+const inter = Inter({
+ subsets: ['latin'],
+ variable: '--font-inter',
+})
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+
+
+
+ )
+}
+```
+
+
+
+最後に、CSS変数を[Tailwind CSS設定](/docs/app/building-your-application/styling/tailwind-css#configuring-tailwind)に追加します:
+
+```js filename="tailwind.config.js"
+/** @type {import('tailwindcss').Config} */
+module.exports = {
+ content: [
+ './pages/**/*.{js,ts,jsx,tsx}',
+ './components/**/*.{js,ts,jsx,tsx}',
+ './app/**/*.{js,ts,jsx,tsx}',
+ ],
+ theme: {
+ extend: {
+ fontFamily: {
+ sans: ['var(--font-inter)'],
+ mono: ['var(--font-roboto-mono)'],
+ },
+ },
+ },
+ plugins: [],
+}
+```
+
+これで、`font-sans` と `font-mono` ユーティリティクラスを使用して要素にフォントを適用できます。
+
+## プリロード
+
+
+サイトのページでフォント関数が呼び出されると、そのフォントはグローバルに利用可能ではなく、すべてのルートでプリロードされません。代わりに、フォントが使用されるファイルのタイプに基づいて、関連するルートでのみプリロードされます:
+
+- [ユニークページ](/docs/app/building-your-application/routing/pages-and-layouts#pages)の場合、そのページのユニークなルートでプリロードされます。
+- [レイアウト](/docs/app/building-your-application/routing/pages-and-layouts#layouts)の場合、そのレイアウトでラップされたすべてのルートでプリロードされます。
+- [ルートレイアウト](/docs/app/building-your-application/routing/pages-and-layouts#root-layout-required)の場合、すべてのルートでプリロードされます。
+
+
+
+
+
+サイトのページでフォント関数が呼び出されると、そのフォントはグローバルに利用可能ではなく、すべてのルートでプリロードされません。代わりに、フォントが使用されるファイルのタイプに基づいて、関連するルートでのみプリロードされます:
+
+- [ユニークページ](/docs/pages/building-your-application/routing/pages-and-layouts)の場合、そのページのユニークなルートでプリロードされます
+- [カスタムApp](/docs/pages/building-your-application/routing/custom-app)内にある場合、`/pages` 配下のサイトのすべてのルートでプリロードされます
+
+
+
+## フォントの再利用
+
+`localFont` またはGoogleフォント関数を呼び出すたびに、そのフォントはアプリケーション内で1つのインスタンスとしてホストされます。したがって、複数のファイルで同じフォント関数を読み込むと、同じフォントの複数のインスタンスがホストされます。このような状況では、以下の方法を推奨します:
+
+- 共有ファイルでフォントローダー関数を呼び出す
+- 定数としてエクスポートする
+- このフォントを使用したい各ファイルで定数をインポートする
\ No newline at end of file
diff --git a/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/03-scripts.mdx b/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/03-scripts.mdx
new file mode 100644
index 00000000..e30c7740
--- /dev/null
+++ b/apps/docs/content/ja/docs/13/02-app/01-building-your-application/06-optimizing/03-scripts.mdx
@@ -0,0 +1,377 @@
+---
+source-updated-at: 2025-05-16T04:52:11.000Z
+translation-updated-at: 2025-06-06T17:25:27.146Z
+title: スクリプト最適化
+nav_title: スクリプト
+description: 組み込みの Script コンポーネントでサードパーティスクリプトを最適化します。
+related:
+ title: API リファレンス
+ description: next/script API の詳細を学びます。
+ links:
+ - app/api-reference/components/script
+---
+
+{/* このドキュメントの内容は App Router と Pages Router で共有されています。Pages Router 固有のコンテンツを追加するには `コンテンツ` コンポーネントを使用できます。共有コンテンツはコンポーネントでラップしないでください。 */}
+
+
+
+### レイアウトスクリプト
+
+複数のルートでサードパーティスクリプトを読み込むには、`next/script` をインポートし、スクリプトを直接レイアウトコンポーネントに含めます:
+
+```tsx filename="app/dashboard/layout.tsx" switcher
+import Script from 'next/script'
+
+export default function DashboardLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+```jsx filename="app/dashboard/layout.js" switcher
+import Script from 'next/script'
+
+export default function DashboardLayout({ children }) {
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+サードパーティスクリプトは、フォルダルート(例: `dashboard/page.js`)またはネストされたルート(例: `dashboard/settings/page.js`)にユーザーがアクセスしたときにフェッチされます。Next.js は、ユーザーが同じレイアウト内の複数のルート間を移動しても、スクリプトが**一度だけ読み込まれる**ことを保証します。
+
+
+
+### アプリケーションスクリプト
+
+
+
+すべてのルートでサードパーティスクリプトを読み込むには、`next/script` をインポートし、スクリプトを直接ルートレイアウトに含めます:
+
+```tsx filename="app/layout.tsx" switcher
+import Script from 'next/script'
+
+export default function RootLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ return (
+
+ {children}
+
+
+ )
+}
+```
+
+```jsx filename="app/layout.js" switcher
+import Script from 'next/script'
+
+export default function RootLayout({ children }) {
+ return (
+
+ {children}
+
+
+ )
+}
+```
+
+
+
+
+
+すべてのルートでサードパーティスクリプトを読み込むには、`next/script` をインポートし、スクリプトを直接カスタム `_app` に含めます:
+
+```jsx filename="pages/_app.js"
+import Script from 'next/script'
+
+export default function MyApp({ Component, pageProps }) {
+ return (
+ <>
+
+
+ >
+ )
+}
+```
+
+
+
+このスクリプトは、アプリケーション内の**任意の**ルートにアクセスしたときに読み込まれ実行されます。Next.js は、ユーザーが複数のページ間を移動しても、スクリプトが**一度だけ読み込まれる**ことを保証します。
+
+> **推奨事項**: パフォーマンスへの不要な影響を最小限に抑えるため、サードパーティスクリプトは特定のページやレイアウトにのみ含めることを推奨します。
+
+### ストラテジー
+
+`next/script` のデフォルトの動作では任意のページやレイアウトでサードパーティスクリプトを読み込めますが、`strategy` プロパティを使用して読み込み動作を微調整できます:
+
+- `beforeInteractive`: Next.js のコードやページのハイドレーションが行われる前にスクリプトを読み込みます。
+- `afterInteractive`: (**デフォルト**) ページのハイドレーションが一部行われた後にスクリプトを早期に読み込みます。
+- `lazyOnload`: ブラウザのアイドル時間中に後でスクリプトを読み込みます。
+- `worker`: (実験的) スクリプトを Web Worker で読み込みます。
+
+各ストラテジーとそのユースケースについて詳しくは、[`next/script`](/docs/app/api-reference/components/script#strategy) API リファレンスドキュメントを参照してください。
+
+### Web Worker へのスクリプトオフロード (実験的)
+
+> **警告:** `worker` ストラテジーはまだ安定しておらず、[`app`](/docs/app/building-your-application/routing/defining-routes) ディレクトリでは動作しません。注意して使用してください。
+
+`worker` ストラテジーを使用するスクリプトは、[Partytown](https://partytown.builder.io/) を使用して Web Worker にオフロードされ実行されます。これにより、メインスレッドをアプリケーションコードの残りの部分に専念させ、サイトのパフォーマンスを向上させることができます。
+
+このストラテジーはまだ実験的であり、`next.config.js` で `nextScriptWorkers` フラグが有効になっている場合にのみ使用できます:
+
+```js filename="next.config.js"
+module.exports = {
+ experimental: {
+ nextScriptWorkers: true,
+ },
+}
+```
+
+次に、`next`(通常は `npm run dev` または `yarn dev`)を実行すると、Next.js がセットアップを完了するために必要なパッケージのインストールを案内します:
+
+```bash filename="Terminal"
+npm run dev
+```
+
+次のような指示が表示されます: `npm install @builder.io/partytown` を実行して Partytown をインストールしてください
+
+セットアップが完了すると、`strategy="worker"` を定義することで、アプリケーション内で Partytown が自動的に初期化され、スクリプトが Web Worker にオフロードされます。
+
+```tsx filename="pages/home.tsx" switcher
+import Script from 'next/script'
+
+export default function Home() {
+ return (
+ <>
+
+ >
+ )
+}
+```
+
+```jsx filename="pages/home.js" switcher
+import Script from 'next/script'
+
+export default function Home() {
+ return (
+ <>
+
+ >
+ )
+}
+```
+
+Web Worker でサードパーティスクリプトを読み込む際には、考慮すべきトレードオフが多数あります。詳細については、Partytown の[トレードオフ](https://partytown.builder.io/trade-offs)ドキュメントを参照してください。
+
+### インラインスクリプト
+
+外部ファイルから読み込まれないインラインスクリプトも Script コンポーネントでサポートされています。中括弧内に JavaScript を記述することで記述できます:
+
+```jsx
+
+```
+
+または、`dangerouslySetInnerHTML` プロパティを使用することもできます:
+
+```jsx
+
+```
+
+> **警告**: インラインスクリプトには、Next.js がスクリプトを追跡して最適化するために `id` プロパティを割り当てる必要があります。
+
+### 追加コードの実行
+
+Script コンポーネントでイベントハンドラを使用すると、特定のイベント発生後に追加のコードを実行できます:
+
+- `onLoad`: スクリプトの読み込みが完了した後にコードを実行します。
+- `onReady`: スクリプトの読み込みが完了し、コンポーネントがマウントされるたびにコードを実行します。
+- `onError`: スクリプトの読み込みに失敗した場合にコードを実行します。
+
+
+
+これらのハンドラは、`next/script` がインポートされ、`"use client"` がコードの最初の行として定義された[クライアントコンポーネント](/docs/app/building-your-application/rendering/client-components)内で使用された場合にのみ機能します:
+
+```tsx filename="app/page.tsx" switcher
+'use client'
+
+import Script from 'next/script'
+
+export default function Page() {
+ return (
+ <>
+
+```
+
+または、`dangerouslySetInnerHTML`プロパティを使用することもできます:
+
+```jsx
+
+```
+
+> **警告**: インラインスクリプトには、Next.jsがスクリプトを追跡して最適化するために`id`プロパティを割り当てる必要があります。
+
+### 追加コードの実行
+
+Scriptコンポーネントでイベントハンドラを使用すると、特定のイベント発生後に追加のコードを実行できます:
+
+- `onLoad`: スクリプトの読み込みが完了した後にコードを実行します。
+- `onReady`: スクリプトの読み込みが完了し、コンポーネントがマウントされるたびにコードを実行します。
+- `onError`: スクリプトの読み込みに失敗した場合にコードを実行します。
+
+
+
+これらのハンドラは、`next/script`がインポートされ、`"use client"`がコードの最初の行として定義されている[クライアントコンポーネント](/docs/app/building-your-application/rendering/client-components)内で使用された場合にのみ機能します:
+
+```tsx filename="app/page.tsx" switcher
+'use client'
+
+import Script from 'next/script'
+
+export default function Page() {
+ return (
+ <>
+