Mailspring/docs/Switch.html
2015-10-03 13:56:58 -07:00

17 lines
667 B
HTML

---
layout: docs
title: Switch
edit_url: "https://github.com/nylas/N1/blob/master/src/components/switch.cjsx"
---
<h2>Summary</h2>
<div class="markdown-from-sourecode">
<p><p>A small React component which renders as a horizontal on/off switch.
Provide it with <code>onChange</code> and <code>checked</code> props just like a checkbox:</p>
<pre><code><span class="hljs-tag">&lt;<span class="hljs-title">Switch</span> <span class="hljs-attribute">onChange</span>=<span class="hljs-value">{@_onToggleChecked}</span> <span class="hljs-attribute">checked</span>=<span class="hljs-value">{@state.form.isChecked}</span> /&gt;</span>
</code></pre></p>
</div>
<ul>
</ul>