Skip to main content

Switch Button API Overview

Initialization

<script>
import { Switch } from "wx-svelte-core";
</script>

<!-- minimal configuration for initialization -->
<Switch />
tip
  • Visit the Features Guide to learn more about the control's functionality.
  • Explore the samples to visualize the available features.

Switch Button Properties

checkeddefines whether a control is switched on/off
disableddefines whether a switch button is disabled
idsets an HTML id for a switch button
valuesets the state of the Switch button