Skip to content

Commit 8b0da7b

Browse files
authored
Merge pull request #16 from linkdd/patch-1
docs: Document new options for `M.AutoInit()`
2 parents 3d9e3d9 + 7e2f8fd commit 8b0da7b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

auto-init.html

+18-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,24 @@
1313
<div class="col s12 m8 offset-m1 xl7 offset-xl1">
1414
<div id="introduction" class="section scrollspy">
1515
<p class="caption">
16-
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
17-
method.
16+
Auto Init allows you to initialize all of the Materialize Components with a single function call.
1817
</p>
1918
</div>
2019

2120
<div id="initialization" class="scrollspy section">
2221
<h3 class="header">Initialization</h3>
2322
<pre><code class="language-javascript">M.AutoInit();</code></pre>
23+
24+
<p>Or with options to configure each components:</p>
25+
<pre><code class="language-javascript">M.AutoInit(document.body, {
26+
Dropdown: {
27+
// pass options for Dropdown here
28+
},
29+
FloatingActionButtonOptions: {
30+
// pass options for FloatingActionButtonOptions here
31+
},
32+
// Component: { ... }
33+
});</code></pre>
2434
</div>
2535

2636
<div id="options" class="scrollspy section">
@@ -42,6 +52,12 @@ <h3 class="header">Options</h3>
4252
<td>document.body</td>
4353
<td>DOM Element to search within for components.</td>
4454
</tr>
55+
<tr>
56+
<td>options</td>
57+
<td>Object</td>
58+
<td><pre><code>{}</code></pre></td>
59+
<td>Options for each component (see components respective documentation for more information).</td>
60+
</tr>
4561
</tbody>
4662
</table>
4763
</div>

0 commit comments

Comments
 (0)