Skip to content

Commit

Permalink
doc: document new options for M.AutoInit
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdd authored Nov 6, 2024
1 parent fb7617f commit 7e2f8fd
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions auto-init.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@
<div class="col s12 m8 offset-m1 xl7 offset-xl1">
<div id="introduction" class="section scrollspy">
<p class="caption">
Auto Init allows you to initialize all of the Materialize Components with a single function call. It is important to note that you cannot pass in options using this
method.
Auto Init allows you to initialize all of the Materialize Components with a single function call.
</p>
</div>

<div id="initialization" class="scrollspy section">
<h3 class="header">Initialization</h3>
<pre><code class="language-javascript">M.AutoInit();</code></pre>

<p>Or with options to configure each components:</p>
<pre><code class="language-javascript">M.AutoInit(document.body, {
Dropdown: {
// pass options for Dropdown here
},
FloatingActionButtonOptions: {
// pass options for FloatingActionButtonOptions here
},
// Component: { ... }
});</code></pre>
</div>

<div id="options" class="scrollspy section">
Expand All @@ -42,6 +52,12 @@ <h3 class="header">Options</h3>
<td>document.body</td>
<td>DOM Element to search within for components.</td>
</tr>
<tr>
<td>options</td>
<td>Object</td>
<td><pre><code>{}</code></pre></td>
<td>Options for each component (see components respective documentation for more information).</td>
</tr>
</tbody>
</table>
</div>
Expand Down

0 comments on commit 7e2f8fd

Please sign in to comment.