Switch 开关

优质
小牛编辑
124浏览
2023-12-01

Represent the switching between two states or on-off state.

Basic

<switch checked="checked">Subscribe to weekly newsletter</switch>

Text & icon

With text and icon.

<p>
  <switch checked-text="开" unchecked-text="关" checked="checked" />
</p>
<p>
  <switch checked-text="1" unchecked-text="0" />
</p>
<p>
  <switch checked-icon="check" unchecked-icon="close" checked="checked" />
</p>

Disabled

<p>
  <switch disabled="disabled">Disabled</switch>
</p>
<p>
  <switch disabled="disabled" checked="checked">Disabled Checked</switch>
</p>