mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
17 lines
667 B
HTML
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"><<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> /></span>
|
|
</code></pre></p>
|
|
</div>
|
|
|
|
<ul>
|
|
</ul>
|