<Switch />



A switch is an UI element that can be used to toggle between two states.

The state of a switch in Onsen UI can be changed both by dragging the knob and by tapping on the switch.

To make the switch enabled by default you can use the checked prop just like with radio buttons and checkboxes.

<Switch checked={this.state.checked} onChange={this.handleChange} />

To disable the switch the disabled prop is used.


名前 型 / デフォルト値 概要
onChange function Called when the value of the switch changes (checked/unchecked) (翻訳中) Optional.
checked bool Whether the switch is checked. (翻訳中) Optional.
disabled bool If set, the switch is disabled. (翻訳中) Optional.
inputId string Specify the id attribute of the inner <input> element. This is useful when using <label for="..."> elements. (翻訳中) Optional.


Name 概要
material Material Design switch (翻訳中)


Onsen UIに関する質問は、Stack Overflowにてonsen-uiタグを付与してください。Onsen UIチームはあなたの問題解決をお手伝いします。

バグ報告や機能要望については、GitHub Issuesに記載をお願いいたします。