aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/html/element/slot
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja/web/html/element/slot')
-rw-r--r--files/ja/web/html/element/slot/index.html122
1 files changed, 122 insertions, 0 deletions
diff --git a/files/ja/web/html/element/slot/index.html b/files/ja/web/html/element/slot/index.html
new file mode 100644
index 0000000000..7c3306b0b7
--- /dev/null
+++ b/files/ja/web/html/element/slot/index.html
@@ -0,0 +1,122 @@
+---
+title: <slot>
+slug: Web/HTML/Element/slot
+tags:
+ - HTML
+ - HTML ウェブコンポーネント
+ - Reference
+ - ウェブコンポーネント
+ - シャドウ DOM
+ - 要素
+translation_of: Web/HTML/Element/slot
+---
+<div>{{HTMLRef}}</div>
+
+<p><span class="seoSummary"><strong>HTML の <code>&lt;slot&gt;</code> 要素</strong> — <a href="/ja/docs/Web/Web_Components">ウェブコンポーネント</a>技術の一部 — は、ウェブコンポーネント内で別な DOM ツリーを構築し、いっしょに表示することができる独自のマークアップを入れることができるプレイスホルダーです。</span></p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/ja/docs/Web/HTML/Content_categories">コンテンツカテゴリ</a></th>
+ <td><a href="/ja/docs/Web/HTML/Content_categories#Flow_content">フローコンテンツ</a>, <a href="/ja/docs/Web/HTML/Content_categories#Phrasing_content">記述コンテンツ</a></td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている内容</th>
+ <td><a href="/ja/docs/Web/HTML/Content_categories#Transparent_content_model">透過的コンテンツ</a></td>
+ </tr>
+ <tr>
+ <th scope="row">イベント</th>
+ <td>{{event("slotchange")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">タグの省略</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている親要素</th>
+ <td>Any element that accepts <a href="/ja/docs/Web/HTML/Content_categories#Phrasing_content">記述コンテンツ</a></td>
+ </tr>
+ <tr>
+ <th scope="row">許可されている ARIA ロール</th>
+ <td>なし</td>
+ </tr>
+ <tr>
+ <th scope="row">DOM インターフェイス</th>
+ <td>{{domxref("HTMLSlotElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Attributes" name="Attributes">属性</h2>
+
+<p>この要素には<a href="/ja/docs/Web/HTML/Global_attributes">グローバル属性</a>があります。</p>
+
+<dl>
+ <dt>{{htmlattrdef("name")}}</dt>
+ <dd>スロットの名前です。</dd>
+ <dd><strong><dfn>名前付きスロット</dfn></strong>は、 <code>&lt;slot&gt;</code> 要素に <code>name</code> 属性が付きます。</dd>
+</dl>
+
+<h2 id="例">例</h2>
+
+<pre class="brush: html">&lt;template id="element-details-template"&gt;
+ &lt;style&gt;
+ details {font-family: "Open Sans Light", Helvetica, Arial, sans-serif }
+ .name {font-weight: bold; color: #217ac0; font-size: 120% }
+ h4 {
+  margin: 10px 0 -8px 0;
+ background: #217ac0;
+  color: white;
+  padding: 2px 6px;
+ border: 1px solid #cee9f9;
+  border-radius: 4px;
+  }
+ .attributes { margin-left: 22px; font-size: 90% }
+ .attributes p { margin-left: 16px; font-style: italic }
+ &lt;/style&gt;
+ &lt;details&gt;
+ &lt;summary&gt;
+ &lt;code class="name"&gt;&amp;lt;&lt;slot name="element-name"&gt;NEED NAME&lt;/slot&gt;&amp;gt;&lt;/code&gt;
+ &lt;i class="desc"&gt;&lt;slot name="description"&gt;NEED DESCRIPTION&lt;/slot&gt;&lt;/i&gt;
+ &lt;/summary&gt;
+ &lt;div class="attributes"&gt;
+ &lt;h4&gt;Attributes&lt;/h4&gt;
+ &lt;slot name="attributes"&gt;&lt;p&gt;None&lt;/p&gt;&lt;/slot&gt;
+ &lt;/div&gt;
+ &lt;/details&gt;
+ &lt;hr&gt;
+&lt;/template&gt;</pre>
+
+<div class="note">
+<p><strong>メモ</strong>: この完全な例は、<a class="external external-icon" href="https://github.com/mdn/web-components-examples/tree/master/element-details" rel="noopener">要素の詳細</a>で実際に動作しています (<a class="external external-icon" href="https://mdn.github.io/web-components-examples/element-details/" rel="noopener">running live</a>ライブ実行もご覧ください)。また、<a href="/ja/docs/Web/Web_Components/Using_templates_and_slots">テンプレートとスロットの利用</a>にも説明があります。</p>
+</div>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ <th scope="col">備考</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG','scripting.html#the-slot-element','&lt;slot&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('DOM WHATWG','#shadow-tree-slots','Slots')}}</td>
+ <td>{{Spec2('DOM WHATWG')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>
+
+<div class="hidden">このページの互換性表は構造化データから作成されています。データに協力したい場合は、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送ってください。</div>
+
+<p>{{Compat("html.elements.slot")}}</p>